add main setup
This commit is contained in:
parent
befad97cc1
commit
826e400150
2 changed files with 11 additions and 4 deletions
|
|
@ -15,6 +15,7 @@ class SubTest(TypedDict):
|
|||
|
||||
class Runner:
|
||||
test_dir_name: Optional[str] = None
|
||||
main_setup_name: Optional[str] = None
|
||||
main_test_name: Optional[str] = None
|
||||
sub_tests: list[SubTest] = []
|
||||
dependencies: list[str] = []
|
||||
|
|
@ -31,9 +32,12 @@ class Runner:
|
|||
self.root_dir = Path(__file__).parent
|
||||
|
||||
def _run_main_test(self):
|
||||
if isinstance(self.main_setup_name, str):
|
||||
full_path = self.root_dir / self.test_dir_name / self.main_setup_name
|
||||
self._run_pytest(full_path)
|
||||
if isinstance(self.main_test_name, str):
|
||||
full_test_path = self.root_dir / self.test_dir_name / self.main_test_name
|
||||
self._run_pytest(full_test_path)
|
||||
full_path = self.root_dir / self.test_dir_name / self.main_test_name
|
||||
self._run_pytest(full_path)
|
||||
|
||||
def _run_pytest(self, full_test_path: Path):
|
||||
"""runs pytest programmatically
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue