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

10 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2024-08-12 19:13 +0000

1import subprocess 1feabcd

2from pathlib import Path 1feabcd

3 

4from ....conftest import needs_py39 1feabcd

5 

6 

7@needs_py39 1feabcd

8def test_run_tests(clear_sqlmodel): 1eabcd

9 from docs_src.tutorial.fastapi.app_testing.tutorial001_py39 import test_main as mod 1abcd

10 

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

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

13 result = subprocess.run( 1abcd

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") 1abcd