Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 09ccfce

Browse files
authored
✅ Simplify tests for path_query_params (#13181)
1 parent ec46247 commit 09ccfce

2 files changed

Lines changed: 14 additions & 184 deletions

File tree

tests/test_tutorial/test_query_params/test_tutorial006.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
1+
import importlib
2+
13
import pytest
24
from dirty_equals import IsDict
35
from fastapi.testclient import TestClient
46

7+
from ...utils import needs_py310
8+
59

6-
@pytest.fixture(name="client")
7-
def get_client():
8-
from docs_src.query_params.tutorial006 import app
10+
@pytest.fixture(
11+
name="client",
12+
params=[
13+
"tutorial006",
14+
pytest.param("tutorial006_py310", marks=needs_py310),
15+
],
16+
)
17+
def get_client(request: pytest.FixtureRequest):
18+
mod = importlib.import_module(f"docs_src.query_params.{request.param}")
919

10-
c = TestClient(app)
20+
c = TestClient(mod.app)
1121
return c
1222

1323

tests/test_tutorial/test_query_params/test_tutorial006_py310.py

Lines changed: 0 additions & 180 deletions
This file was deleted.

0 commit comments

Comments
 (0)