Browse Source

Tweak Python 3.10-only test to not break below 3.10

pull/11355/head
Sebastián Ramírez 8 months ago
parent
commit
6b68de7f42
  1. 22
      tests/test_stringified_annotations_simple.py

22
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"
@needs_py310
def test_stringified_annotations():
app = FastAPI()
client = TestClient(app)
@app.get("/test/")
def call(test: Annotated[str, Depends(Dep())]):
return {"test": test}
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():
response = client.get("/test")
assert response.status_code == 200

Loading…
Cancel
Save