Coverage for tests/test_tutorial/test_fastapi/test_app_testing/test_tutorial001_py310_tests_main.py: 100%

10 statements  

« prev     ^ index     » next       coverage.py v7.7.1, created at 2025-03-24 00:02 +0000

1import subprocess 1abcdef

2from pathlib import Path 1abcdef

3 

4from ....conftest import needs_py310 1abcdef

5 

6 

7@needs_py310 1abcdef

8def test_run_tests(clear_sqlmodel): 1abcdef

9 from docs_src.tutorial.fastapi.app_testing.tutorial001_py310 import test_main as mod 1ghij

10 

11 test_path = Path(mod.__file__).resolve().parent 1ghij

12 top_level_path = Path(__file__).resolve().parent.parent.parent.parent.parent 1ghij

13 result = subprocess.run( 1ghij

14 [ 

15 "coverage", 

16 "run", 

17 "--parallel-mode", 

18 "-m", 

19 "pytest", 

20 test_path, 

21 ], 

22 cwd=top_level_path, 

23 capture_output=True, 

24 ) 

25 assert result.returncode == 0, result.stdout.decode("utf-8") 1ghij