From 6b68de7f4231d73cab3bd751fe655b4facb68b8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Wed, 3 Dec 2025 14:38:48 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20Tweak=20Python=203.10-only=20test?= =?UTF-8?q?=20to=20not=20break=20below=203.10?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_stringified_annotations_simple.py | 26 +++++++++----------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/tests/test_stringified_annotations_simple.py b/tests/test_stringified_annotations_simple.py index 1a79590f2..eea0ac23d 100644 --- a/tests/test_stringified_annotations_simple.py +++ b/tests/test_stringified_annotations_simple.py @@ -6,22 +6,20 @@ from typing_extensions import Annotated from .utils import needs_py310 -app = FastAPI() - -client = TestClient(app) - - -class Dep: - def __call__(self, request: Request): - return "test" - - -@app.get("/test/") -def call(test: Annotated[str, Depends(Dep())]): - return {"test": test} - @needs_py310 def test_stringified_annotations(): + app = FastAPI() + + client = TestClient(app) + + class Dep: + def __call__(self, request: Request): + return "test" + + @app.get("/test/") + def call(test: Annotated[str, Depends(Dep())]): + return {"test": test} + response = client.get("/test") assert response.status_code == 200