- Sort Score
- Num 10 results
- Language All
Results 61 - 70 of 652 for tutorial003_py39 (0.34 seconds)
-
tests/test_tutorial/test_custom_request_and_route/test_tutorial003.py
import importlib import pytest from fastapi.testclient import TestClient from tests.utils import needs_py310 @pytest.fixture( name="client", params=[ pytest.param("tutorial003_py39"), pytest.param("tutorial003_py310", marks=needs_py310), ], ) def get_client(request: pytest.FixtureRequest): mod = importlib.import_module(f"docs_src.custom_request_and_route.{request.param}")
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 894 bytes - Click Count (0) -
tests/test_tutorial/test_handling_errors/test_tutorial003.py
from fastapi.testclient import TestClient from docs_src.handling_errors.tutorial003_py39 import app client = TestClient(app) def test_get(): response = client.get("/unicorns/shinny") assert response.status_code == 200, response.text assert response.json() == {"unicorn_name": "shinny"} def test_get_exception(): response = client.get("/unicorns/yolo") assert response.status_code == 418, response.text
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 3.2K bytes - Click Count (0) -
tests/test_tutorial/test_path_params_numeric_validations/test_tutorial002_tutorial003.py
import importlib import pytest from fastapi.testclient import TestClient @pytest.fixture( name="client", params=[ pytest.param("tutorial002_py39"), pytest.param("tutorial002_an_py39"), pytest.param("tutorial003_py39"), pytest.param("tutorial003_an_py39"), ], ) def get_client(request: pytest.FixtureRequest) -> TestClient: mod = importlib.import_module(
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Fri Dec 26 10:43:02 GMT 2025 - 5.6K bytes - Click Count (0) -
tests/test_tutorial/test_path_params/test_tutorial003.py
import pytest from fastapi.testclient import TestClient from docs_src.path_params.tutorial003_py39 import app client = TestClient(app) @pytest.mark.parametrize( ("user_id", "expected_response"), [ ("me", {"user_id": "the current user"}), ("alice", {"user_id": "alice"}), ], ) def test_get_users(user_id: str, expected_response: dict): response = client.get(f"/users/{user_id}")
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Fri Dec 26 10:43:02 GMT 2025 - 4.6K bytes - Click Count (0) -
tests/test_tutorial/test_path_operation_configurations/test_tutorial003_tutorial004.py
""").strip(), } @pytest.fixture( name="mod_name", params=[ pytest.param("tutorial003_py39"), pytest.param("tutorial003_py310", marks=needs_py310), pytest.param("tutorial004_py39"), pytest.param("tutorial004_py310", marks=needs_py310), ], ) def get_mod_name(request: pytest.FixtureRequest) -> str: return request.param
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Fri Dec 26 10:43:02 GMT 2025 - 7K bytes - Click Count (0) -
tests/test_tutorial/test_events/test_tutorial003.py
from fastapi.testclient import TestClient from docs_src.events.tutorial003_py39 import ( app, fake_answer_to_everything_ml_model, ml_models, ) def test_events(): assert not ml_models, "ml_models should be empty" with TestClient(app) as client: assert ml_models["answer_to_everything"] == fake_answer_to_everything_ml_model response = client.get("/predict", params={"x": 2})
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 3.6K bytes - Click Count (0) -
docs/ru/docs/tutorial/metadata.md
* Вы можете отключить это с помощью настройки `redoc_url=None`. К примеру, чтобы задать отображение Swagger UI по адресу `/documentation` и отключить ReDoc:
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 9.3K bytes - Click Count (0) -
docs/en/docs/advanced/path-operation-advanced-configuration.md
To exclude a *path operation* from the generated OpenAPI schema (and thus, from the automatic documentation systems), use the parameter `include_in_schema` and set it to `False`: {* ../../docs_src/path_operation_advanced_configuration/tutorial003_py39.py hl[6] *} ## Advanced description from docstring { #advanced-description-from-docstring } You can limit the lines used from the docstring of a *path operation function* for OpenAPI.
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Dec 20 15:55:38 GMT 2025 - 7.2K bytes - Click Count (0) -
docs/ru/docs/tutorial/handling-errors.md
И вы хотите обрабатывать это исключение глобально с помощью FastAPI. Можно добавить собственный обработчик исключений с помощью `@app.exception_handler()`: {* ../../docs_src/handling_errors/tutorial003_py39.py hl[5:7,13:18,24] *} Здесь, если запросить `/unicorns/yolo`, то *операция пути* вызовет `UnicornException`. Но оно будет обработано `unicorn_exception_handler`.
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 14.1K bytes - Click Count (0) -
tests/test_tutorial/test_body_multiple_params/test_tutorial003.py
import importlib import pytest from fastapi.testclient import TestClient from ...utils import needs_py310 @pytest.fixture( name="client", params=[ "tutorial003_py39", pytest.param("tutorial003_py310", marks=needs_py310), "tutorial003_an_py39", pytest.param("tutorial003_an_py310", marks=needs_py310), ], ) def get_client(request: pytest.FixtureRequest):
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Dec 27 18:19:10 GMT 2025 - 7.4K bytes - Click Count (0)