- Sort Score
- Result 10 results
- Languages All
Results 1581 - 1590 of 1,992 for Fastapi (0.04 sec)
-
docs/ko/docs/advanced/async-tests.md
# 비동기 테스트 코드 작성 이전 장에서 `TestClient` 를 이용해 **FastAPI** 어플리케이션 테스트를 작성하는 법을 배우셨을텐데요. 지금까지는 `async` 키워드 사용없이 동기 함수의 테스트 코드를 작성하는 법만 익혔습니다. 하지만 비동기 함수를 사용하여 테스트 코드를 작성하는 것은 매우 유용할 수 있습니다. 예를 들면 데이터베이스에 비동기로 쿼리하는 경우를 생각해봅시다. FastAPI 애플리케이션에 요청을 보내고, 비동기 데이터베이스 라이브러리를 사용하여 백엔드가 데이터베이스에 올바르게 데이터를 기록했는지 확인하고 싶을 때가 있을 겁니다. 이런 경우의 테스트 코드를 어떻게 비동기로 작성하는지 알아봅시다. ## pytest.mark.anyio 앞에서 작성한 테스트 함수에서 비동기 함수를 호출하고 싶다면, 테스트 코드도 비동기 함수여야합니다.
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Tue Dec 10 11:03:16 UTC 2024 - 4.7K bytes - Viewed (0) -
tests/test_tutorial/test_response_model/test_tutorial003_04.py
import importlib import pytest from fastapi.exceptions import FastAPIError from ...utils import needs_py310 @pytest.mark.parametrize( "module_name", [ pytest.param("tutorial003_04_py39"), pytest.param("tutorial003_04_py310", marks=needs_py310), ], ) def test_invalid_response_model(module_name: str) -> None: with pytest.raises(FastAPIError):
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 453 bytes - Viewed (0) -
docs/ko/docs/tutorial/encoder.md
# JSON 호환 가능 인코더 데이터 유형(예: Pydantic 모델)을 JSON과 호환된 형태로 반환해야 하는 경우가 있습니다. (예: `dict`, `list` 등) 예를 들면, 데이터베이스에 저장해야하는 경우입니다. 이를 위해, **FastAPI** 에서는 `jsonable_encoder()` 함수를 제공합니다. ## `jsonable_encoder` 사용 JSON 호환 가능 데이터만 수신하는 `fake_db` 데이터베이스가 존재한다고 가정하겠습니다. 예를 들면, `datetime` 객체는 JSON과 호환되는 데이터가 아니므로 이 데이터는 받아들여지지 않습니다.
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Mon Nov 18 02:25:44 UTC 2024 - 1.9K bytes - Viewed (0) -
tests/test_tutorial/test_body_updates/test_tutorial002.py
import importlib import pytest from fastapi.testclient import TestClient from ...utils import needs_py310 @pytest.fixture( name="client", params=[ pytest.param("tutorial002_py39"), pytest.param("tutorial002_py310", marks=needs_py310), ], ) def get_client(request: pytest.FixtureRequest): mod = importlib.import_module(f"docs_src.body_updates.{request.param}") client = TestClient(mod.app)
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 7.1K bytes - Viewed (0) -
tests/test_tutorial/test_cookie_param_models/test_tutorial002.py
import importlib import pytest from fastapi.testclient import TestClient from inline_snapshot import snapshot from tests.utils import needs_py310 @pytest.fixture( name="client", params=[ pytest.param("tutorial002_py39"), pytest.param("tutorial002_py310", marks=[needs_py310]), pytest.param("tutorial002_an_py39"), pytest.param("tutorial002_an_py310", marks=[needs_py310]), ], )
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 6.3K bytes - Viewed (0) -
docs/ko/docs/tutorial/request-form-models.md
```console $ pip install python-multipart ``` /// /// note | 참고 이 기능은 FastAPI 버전 `0.113.0` 이후부터 지원됩니다. 🤓 /// ## Pydantic 모델을 사용한 폼 **폼 필드**로 받고 싶은 필드를 **Pydantic 모델**로 선언한 다음, 매개변수를 `Form`으로 선언하면 됩니다: {* ../../docs_src/request_form_models/tutorial001_an_py39.py hl[9:11,15] *} **FastAPI**는 요청에서 받은 **폼 데이터**에서 **각 필드**에 대한 데이터를 **추출**하고 정의한 Pydantic 모델을 줍니다. ## 문서 확인하기Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Mon Dec 09 12:44:27 UTC 2024 - 2.3K bytes - Viewed (0) -
docs/zh-hant/docs/tutorial/query-param-models.md
如果你有一組具有相關性的**查詢參數**,你可以建立一個 **Pydantic 模型**來聲明它們。 這將允許你在**多個地方**去**重複使用模型**,並且一次性為所有參數聲明驗證和元資料 (metadata)。😎 /// note FastAPI 從 `0.115.0` 版本開始支援這個特性。🤓 /// ## 使用 Pydantic 模型的查詢參數 在一個 **Pydantic 模型**中聲明你需要的**查詢參數**,然後將參數聲明為 `Query`: {* ../../docs_src/query_param_models/tutorial001_an_py310.py hl[9:13,17] *} **FastAPI** 將會從請求的**查詢參數**中**提取**出**每個欄位**的資料,並將其提供給你定義的 Pydantic 模型。 ## 查看文件 你可以在 `/docs` 頁面的 UI 中查看查詢參數:Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Nov 27 22:14:10 UTC 2024 - 2K bytes - Viewed (0) -
docs/missing-translation.md
We’re currently switching to an automated translation system 🤖, which will help keep all translations complete and up to date. Learn more: [Contributing – Translations](https://fastapi.tiangolo.com/contributing/#translations){.internal-link target=_blank}Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Thu Oct 30 19:50:37 UTC 2025 - 347 bytes - Viewed (0) -
docs_src/bigger_applications/app_an_py39/routers/users.py
from fastapi import APIRouter router = APIRouter() @router.get("/users/", tags=["users"]) async def read_users(): return [{"username": "Rick"}, {"username": "Morty"}] @router.get("/users/me", tags=["users"]) async def read_user_me(): return {"username": "fakecurrentuser"} @router.get("/users/{username}", tags=["users"]) async def read_user(username: str):
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 407 bytes - Viewed (0) -
docs_src/bigger_applications/app_py39/routers/users.py
from fastapi import APIRouter router = APIRouter() @router.get("/users/", tags=["users"]) async def read_users(): return [{"username": "Rick"}, {"username": "Morty"}] @router.get("/users/me", tags=["users"]) async def read_user_me(): return {"username": "fakecurrentuser"} @router.get("/users/{username}", tags=["users"]) async def read_user(username: str):
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 407 bytes - Viewed (0)