Browse Source

expand needs_py310 scope

pull/11355/head
svlandeg 8 months ago
parent
commit
91576992dd
  1. 11
      tests/test_future/test_future_6465.py
  2. 9
      tests/test_future/test_future_9095.py

11
tests/test_future/test_future_6465.py

@ -20,13 +20,12 @@ class Item(BaseModel):
tax: Optional[float] = None tax: Optional[float] = None
@app.get("/items/")
@login_required
def get_item(item_id: int) -> Item:
return Item(name="name", price=42.42)
@needs_py310 @needs_py310
def test_future_6465(): def test_future_6465():
@app.get("/items/")
@login_required
def get_item(item_id: int) -> Item:
return Item(name="name", price=42.42)
res = client.get("/items?item_id=3") res = client.get("/items?item_id=3")
assert res.status_code == 200 assert res.status_code == 200

9
tests/test_future/test_future_9095.py

@ -16,12 +16,11 @@ class Test:
return "test" return "test"
@app.get("/test/")
def call(test: str = Depends(Test())):
return {"test": test}
@needs_py310 @needs_py310
def test_call(): def test_call():
@app.get("/test/")
def call(test: str = Depends(Test())):
return {"test": test}
response = client.get("/test") response = client.get("/test")
assert response.status_code == 200 assert response.status_code == 200

Loading…
Cancel
Save