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

8 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2024-09-09 00:02 +0000

1import subprocess 1ghijkl

2from pathlib import Path 1ghijkl

3 

4 

5def test_run_tests(clear_sqlmodel): 1ghijkl

6 from docs_src.tutorial.fastapi.app_testing.tutorial001 import test_main as mod 1abcdef

7 

8 test_path = Path(mod.__file__).resolve().parent 1abcdef

9 top_level_path = Path(__file__).resolve().parent.parent.parent.parent.parent 1abcdef

10 result = subprocess.run( 1abcdef

11 [ 

12 "coverage", 

13 "run", 

14 "--parallel-mode", 

15 "-m", 

16 "pytest", 

17 test_path, 

18 ], 

19 cwd=top_level_path, 

20 capture_output=True, 

21 ) 

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