diff --git a/pytest_abra/dir_manager.py b/pytest_abra/dir_manager.py index 1ff4c11..c54954b 100644 --- a/pytest_abra/dir_manager.py +++ b/pytest_abra/dir_manager.py @@ -37,6 +37,7 @@ class DirManager: self.STATES, self.ENV_FILES, self.RESULTS, + self.STATUS, ] for d in dirs: d.mkdir(exist_ok=True) @@ -69,6 +70,10 @@ class DirManager: def RESULTS(self): return self.SESSION / "results" + @property + def STATUS(self): + return self.SESSION / "status" + @property def RECIPES(self): return self.recipes_dir diff --git a/pytest_abra/runner.py b/pytest_abra/runner.py index c8c3812..055c7c1 100644 --- a/pytest_abra/runner.py +++ b/pytest_abra/runner.py @@ -119,13 +119,13 @@ class Runner: other than 'passed' will be deleted""" already_passed = False - for result in self.DIR.RESULTS.glob("*"): - if identifier_string in result.name: + for status in self.DIR.STATUS.glob("*"): + if identifier_string in status.name: # process any result file (passed / failed / skipped) if it exists - if "passed" in result.name: + if "passed" in status.name: already_passed = True elif remove_existing: - result.unlink() + status.unlink() return already_passed def _call_pytest(self, full_test_path: Path) -> int: @@ -189,7 +189,7 @@ class Runner: if isinstance(result, int): result = cls.result_int_to_str(result) full_name = cls.combine_names(result, identifier_string) - file_path = DIR.RESULTS / full_name + file_path = DIR.STATUS / full_name with open(file_path, "w") as _: pass # create empty file @@ -198,7 +198,7 @@ class Runner: # todo: what about conditional setups? - passed_tests = [r.name for r in self.DIR.RESULTS.glob("*") if "passed" in r.name] + passed_tests = [r.name for r in self.DIR.STATUS.glob("*") if "passed" in r.name] results = [] for dependency in self.dependencies: dependency_runner = self.coordinator.RUNNER_DICT[dependency]