Coverage for tests/test_tutorial/test_testing/test_main_b.py: 100%
16 statements
« prev ^ index » next coverage.py v7.6.1, created at 2025-12-04 08:29 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2025-12-04 08:29 +0000
1import importlib 1abcdefg
2from types import ModuleType 1abcdefg
4import pytest 1abcdefg
6from ...utils import needs_py39, needs_py310 1abcdefg
9@pytest.fixture( 1abcdefg
10 name="test_module",
11 params=[
12 "app_b.test_main",
13 pytest.param("app_b_py310.test_main", marks=needs_py310),
14 "app_b_an.test_main",
15 pytest.param("app_b_an_py39.test_main", marks=needs_py39),
16 pytest.param("app_b_an_py310.test_main", marks=needs_py310),
17 ],
18)
19def get_test_module(request: pytest.FixtureRequest) -> ModuleType: 1abcdefg
20 mod: ModuleType = importlib.import_module(f"docs_src.app_testing.{request.param}") 1abcdefg
21 return mod 1abcdefg
24def test_app(test_module: ModuleType): 1abcdefg
25 test_main = test_module 1hijklmn
26 test_main.test_create_existing_item() 1hijklmn
27 test_main.test_create_item() 1hijklmn
28 test_main.test_create_item_bad_token() 1hijklmn
29 test_main.test_read_nonexistent_item() 1hijklmn
30 test_main.test_read_item() 1hijklmn
31 test_main.test_read_item_bad_token() 1hijklmn