mirror of https://github.com/tiangolo/fastapi.git
✅ Tweak Python 3.10-only test to not break below 3.10
This commit is contained in:
parent
61ef22512e
commit
6b68de7f42
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue