|
|
|
@ -7,16 +7,17 @@ from typing_extensions import Annotated |
|
|
|
from .utils import needs_py310 |
|
|
|
|
|
|
|
|
|
|
|
class Dep: |
|
|
|
def __call__(self, request: Request): |
|
|
|
return "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} |
|
|
|
|