- Sort Score
- Result 10 results
- Languages All
Results 451 - 460 of 643 for tutorial005_py39 (0.06 sec)
-
tests/test_tutorial/test_dependencies/test_tutorial008.py
from unittest.mock import Mock, patch import pytest from fastapi import Depends, FastAPI from fastapi.testclient import TestClient @pytest.fixture( name="module", params=[ "tutorial008_py39", # Fails with `NameError: name 'DepA' is not defined` pytest.param("tutorial008_an_py39", marks=pytest.mark.xfail), ], ) def get_module(request: pytest.FixtureRequest):
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 1.4K bytes - Viewed (0) -
tests/test_tutorial/test_cors/test_tutorial001.py
from fastapi.testclient import TestClient from docs_src.cors.tutorial001_py39 import app def test_cors(): client = TestClient(app) # Test pre-flight response headers = { "Origin": "https://localhost.tiangolo.com", "Access-Control-Request-Method": "GET", "Access-Control-Request-Headers": "X-Example", } response = client.options("/", headers=headers)
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 1.3K bytes - Viewed (0) -
tests/test_tutorial/test_custom_docs_ui/test_tutorial002.py
@pytest.fixture(scope="module") def client(): static_dir: Path = Path(os.getcwd()) / "static" print(static_dir) static_dir.mkdir(exist_ok=True) from docs_src.custom_docs_ui.tutorial002_py39 import app with TestClient(app) as client: yield client static_dir.rmdir() def test_swagger_ui_html(client: TestClient): response = client.get("/docs")
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 1.2K bytes - Viewed (0) -
tests/test_tutorial/test_custom_request_and_route/test_tutorial001.py
import pytest from fastapi import Request from fastapi.testclient import TestClient from tests.utils import needs_py310 @pytest.fixture( name="client", params=[ pytest.param("tutorial001_py39"), pytest.param("tutorial001_py310", marks=needs_py310), pytest.param("tutorial001_an_py39"), pytest.param("tutorial001_an_py310", marks=needs_py310), ], )
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 1.3K bytes - Viewed (0) -
tests/test_tutorial/test_custom_response/test_tutorial001.py
import importlib import pytest from fastapi.testclient import TestClient @pytest.fixture( name="client", params=[ pytest.param("tutorial001_py39"), pytest.param("tutorial010_py39"), ], ) def get_client(request: pytest.FixtureRequest): mod = importlib.import_module(f"docs_src.custom_response.{request.param}") client = TestClient(mod.app) return client
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 1.3K bytes - Viewed (0) -
docs/ru/docs/advanced/wsgi.md
Нужно импортировать `WSGIMiddleware`. Затем оберните WSGI‑приложение (например, Flask) в middleware (Промежуточный слой). После этого смонтируйте его на путь. {* ../../docs_src/wsgi/tutorial001_py39.py hl[2:3,3] *} ## Проверьте { #check-it } Теперь каждый HTTP‑запрос по пути `/v1/` будет обрабатываться приложением Flask. А всё остальное будет обрабатываться **FastAPI**.
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 1.7K bytes - Viewed (0) -
tests/test_tutorial/test_metadata/test_tutorial001.py
from fastapi.testclient import TestClient from docs_src.metadata.tutorial001_py39 import app client = TestClient(app) def test_items(): response = client.get("/items/") assert response.status_code == 200, response.text assert response.json() == [{"name": "Katana"}] def test_openapi_schema(): response = client.get("/openapi.json") assert response.status_code == 200, response.text assert response.json() == {
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 1.7K bytes - Viewed (0) -
tests/test_tutorial/test_custom_response/test_tutorial001b.py
from fastapi.testclient import TestClient from docs_src.custom_response.tutorial001b_py39 import app client = TestClient(app) def test_get_custom_response(): response = client.get("/items/") assert response.status_code == 200, response.text assert response.json() == [{"item_id": "Foo"}] def test_openapi_schema(): response = client.get("/openapi.json") assert response.status_code == 200, response.text
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 1K bytes - Viewed (0) -
tests/test_tutorial/test_body_nested_models/test_tutorial009.py
import importlib import pytest from fastapi.testclient import TestClient @pytest.fixture( name="client", params=[ "tutorial009_py39", ], ) def get_client(request: pytest.FixtureRequest): mod = importlib.import_module(f"docs_src.body_nested_models.{request.param}") client = TestClient(mod.app) return client def test_post_body(client: TestClient): data = {"2": 2.2, "3": 3.3}
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 4K bytes - Viewed (0) -
tests/test_tutorial/test_cookie_params/test_tutorial001.py
import importlib from types import ModuleType import pytest from fastapi.testclient import TestClient from ...utils import needs_py310 @pytest.fixture( name="mod", params=[ "tutorial001_py39", pytest.param("tutorial001_py310", marks=needs_py310), "tutorial001_an_py39", pytest.param("tutorial001_an_py310", marks=needs_py310), ], ) def get_mod(request: pytest.FixtureRequest):
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 4K bytes - Viewed (0)