- Sort Score
- Result 10 results
- Languages All
Results 331 - 340 of 550 for tutorial009b_py39 (0.07 sec)
-
docs/es/docs/advanced/testing-events.md
{* ../../docs_src/app_testing/tutorial004_py39.py hl[9:15,18,27:28,30:32,41:43] *} Puedes leer más detalles sobre ["Ejecutar lifespan en tests en el sitio oficial de documentación de Starlette."](https://www.starlette.dev/lifespan/#running-lifespan-in-tests) Para los eventos obsoletos `startup` y `shutdown`, puedes usar el `TestClient` así:Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 632 bytes - Viewed (0) -
tests/test_tutorial/test_metadata/test_tutorial002.py
from fastapi.testclient import TestClient from docs_src.metadata.tutorial002_py39 import app client = TestClient(app) def test_items(): response = client.get("/items/") assert response.status_code == 200, response.text assert response.json() == [{"name": "Foo"}] def test_get_openapi_json_default_url(): response = client.get("/openapi.json") assert response.status_code == 404, response.text
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 1.2K bytes - Viewed (0) -
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}")
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 894 bytes - Viewed (0) -
docs/es/docs/tutorial/background-tasks.md
{* ../../docs_src/background_tasks/tutorial001_py39.py hl[6:9] *} ## Agregar la tarea en segundo plano { #add-the-background-task } Dentro de tu *path operation function*, pasa tu función de tarea al objeto de *background tasks* con el método `.add_task()`: {* ../../docs_src/background_tasks/tutorial001_py39.py hl[14] *} `.add_task()` recibe como argumentos:Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 5.1K bytes - Viewed (0) -
tests/test_tutorial/test_middleware/test_tutorial001.py
from fastapi.testclient import TestClient from docs_src.middleware.tutorial001_py39 import app client = TestClient(app) def test_response_headers(): response = client.get("/openapi.json") assert response.status_code == 200, response.text assert "X-Process-Time" in response.headers 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: Fri Dec 26 10:43:02 UTC 2025 - 604 bytes - Viewed (0) -
tests/test_tutorial/test_response_headers/test_tutorial002.py
from fastapi.testclient import TestClient from docs_src.response_headers.tutorial002_py39 import app client = TestClient(app) def test_path_operation(): response = client.get("/headers-and-object/") assert response.status_code == 200, response.text assert response.json() == {"message": "Hello World"}
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 383 bytes - Viewed (0) -
tests/test_tutorial/test_response_headers/test_tutorial001.py
from fastapi.testclient import TestClient from docs_src.response_headers.tutorial001_py39 import app client = TestClient(app) def test_path_operation(): response = client.get("/headers/") assert response.status_code == 200, response.text assert response.json() == {"message": "Hello World"} assert response.headers["X-Cat-Dog"] == "alone in the world"
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 431 bytes - Viewed (0) -
tests/test_tutorial/test_custom_request_and_route/test_tutorial002.py
import pytest from dirty_equals import IsOneOf from fastapi.testclient import TestClient 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 - 1.3K bytes - Viewed (0) -
tests/test_tutorial/test_dependencies/test_tutorial008e.py
import importlib import pytest from fastapi.testclient import TestClient @pytest.fixture( name="client", params=[ pytest.param("tutorial008e_py39"), pytest.param("tutorial008e_an_py39"), ], ) def get_client(request: pytest.FixtureRequest): mod = importlib.import_module(f"docs_src.dependencies.{request.param}") client = TestClient(mod.app) return client
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 574 bytes - Viewed (0) -
docs/ru/docs/advanced/testing-websockets.md
Вы можете использовать тот же `TestClient` для тестирования WebSocket. Для этого используйте `TestClient` с менеджером контекста `with`, подключаясь к WebSocket: {* ../../docs_src/app_testing/tutorial002_py39.py hl[27:31] *} /// note | ПримечаниеRegistered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 655 bytes - Viewed (0)