z0z0r4
3 weeks ago
No known key found for this signature in database
GPG Key ID: 448EF3037425FD6A
2 changed files with
2 additions and
2 deletions
-
docs/en/docs/advanced/testing-events.md
-
docs_src/app_testing/tutorial003.py
|
|
@ -10,4 +10,4 @@ You can read more details about the ["Running lifespan in tests in the official |
|
|
|
|
|
|
|
For the deprecated `startup` and `shutdown` events, you can use the `TestClient` as follows: |
|
|
|
|
|
|
|
{* ../../docs_src/app_testing/tutorial003.py hl[9:12,20:24] *} |
|
|
|
{* ../../docs_src/app_testing/tutorial003.py hl[9:12,20:24] *} |
|
|
|
|
|
@ -25,4 +25,4 @@ def test_read_items(): |
|
|
|
with TestClient(app) as client: |
|
|
|
response = client.get("/items/foo") |
|
|
|
assert response.status_code == 200 |
|
|
|
assert response.json() == {"name": "Fighters"} |
|
|
|
assert response.json() == {"name": "Fighters"} |
|
|
|