diff --git a/tests/test_tutorial/test_path_params/test_tutorial006.py b/tests/test_tutorial/test_path_params/test_tutorial006.py index 7bee367558..5a957323f9 100644 --- a/tests/test_tutorial/test_path_params/test_tutorial006.py +++ b/tests/test_tutorial/test_path_params/test_tutorial006.py @@ -3,10 +3,12 @@ from fastapi.testclient import TestClient app = FastAPI() + @app.get("/items/{item_id}") def read_item(item_id: int = Path(..., ge=1, le=1000)): return {"item_id": item_id} + client = TestClient(app) @@ -28,4 +30,4 @@ def test_item_id_above_range(): def test_invalid_type(): response = client.get("/items/abc") - assert response.status_code == 422 # type validation error \ No newline at end of file + assert response.status_code == 422 # type validation error