mirror of https://github.com/tiangolo/fastapi.git
apply fixture
This commit is contained in:
parent
983c112c61
commit
b4afab0f16
|
|
@ -4,14 +4,14 @@ from fastapi.testclient import TestClient
|
||||||
from tests.utils import needs_py310
|
from tests.utils import needs_py310
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(name="client", marks=[needs_py310])
|
@pytest.fixture(name="client")
|
||||||
def get_client():
|
def get_client():
|
||||||
from docs_src.query_params.tutorial007_py310 import app
|
from docs_src.query_params.tutorial007_py310 import app
|
||||||
|
|
||||||
c = TestClient(app)
|
c = TestClient(app)
|
||||||
return c
|
return c
|
||||||
|
|
||||||
|
@needs_py310
|
||||||
def test_foo_needy_very(client: TestClient):
|
def test_foo_needy_very(client: TestClient):
|
||||||
response = client.get("/query/mixed-type-params?query=1&query=2&foo=bar&foo=baz")
|
response = client.get("/query/mixed-type-params?query=1&query=2&foo=bar&foo=baz")
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
|
|
@ -22,7 +22,7 @@ def test_foo_needy_very(client: TestClient):
|
||||||
"sequence_mapping_int": {"foo": []},
|
"sequence_mapping_int": {"foo": []},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@needs_py310
|
||||||
def test_just_string_not_scalar_mapping(client: TestClient):
|
def test_just_string_not_scalar_mapping(client: TestClient):
|
||||||
response = client.get("/query/mixed-type-params?&query=2&foo=1&bar=3&foo=2&foo=baz")
|
response = client.get("/query/mixed-type-params?&query=2&foo=1&bar=3&foo=2&foo=baz")
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue