1-
21import subprocess
3- import pytest
42
3+ import pytest
54from change_dir import change_dir
65from generate_project import generate_project
76
8-
97PROJECT_SLUG = "test_project"
108PROJECT_NAME = "Test Project"
119
1210
1311def run_tests (project_directory ):
1412 with change_dir (project_directory ):
15- install_result = subprocess .run (["poetry" , "install" ], capture_output = True , text = True )
16- tests_result = subprocess .run (["poetry" , "run" , "tests" ], capture_output = True , text = True )
13+ install_result = subprocess .run (
14+ ["poetry" , "install" ], capture_output = True , text = True
15+ )
16+ tests_result = subprocess .run (
17+ ["poetry" , "run" , "tests" ], capture_output = True , text = True
18+ )
1719
1820 return install_result , tests_result
1921
@@ -26,6 +28,9 @@ def run_tests(project_directory):
2628def test_run_tests_passes (generate_project ):
2729 install_result , tests_result = run_tests (generate_project )
2830
29- assert install_result .returncode == 0 , "'poetry install' command failed in generated book"
30- assert tests_result .returncode == 0 , f"'poetry run tests' command failed in generated book. Output: \n \n { tests_result .stdout } "
31-
31+ assert (
32+ install_result .returncode == 0
33+ ), "'poetry install' command failed in generated book"
34+ assert (
35+ tests_result .returncode == 0
36+ ), f"'poetry run tests' command failed in generated book. Output: \n \n { tests_result .stdout } "
0 commit comments