Use RunnerMeta to save path along with Runner subclass
This commit is contained in:
parent
4f8bceb587
commit
7ec75cd6a0
3 changed files with 21 additions and 20 deletions
|
|
@ -6,9 +6,8 @@ from typing import TYPE_CHECKING, Callable, NamedTuple
|
|||
import pytest
|
||||
from loguru import logger
|
||||
|
||||
from pytest_abra import DirManager
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from pytest_abra import DirManager
|
||||
from pytest_abra.coordinator import Coordinator
|
||||
from pytest_abra.env_manager import EnvFile
|
||||
|
||||
|
|
@ -33,9 +32,10 @@ class Runner:
|
|||
cleanups: list[Test] = []
|
||||
dependencies: list[str] = []
|
||||
|
||||
def __init__(self, coordinator: "Coordinator", runner_index: int):
|
||||
def __init__(self, coordinator: "Coordinator", runner_index: int, runner_dir: Path):
|
||||
self.coordinator = coordinator
|
||||
self.runner_index = runner_index
|
||||
self.runner_dir = runner_dir
|
||||
|
||||
self.DIR = coordinator.DIR
|
||||
self.ENV = coordinator.ENV
|
||||
|
|
@ -180,7 +180,7 @@ class Runner:
|
|||
@classmethod
|
||||
def create_result_file(
|
||||
cls,
|
||||
DIR: DirManager,
|
||||
DIR: "DirManager",
|
||||
result: int | str,
|
||||
identifier_string: str,
|
||||
):
|
||||
|
|
@ -201,7 +201,7 @@ class Runner:
|
|||
passed_tests = [r.name for r in self.DIR.RESULTS.glob("*") if "passed" in r.name]
|
||||
results = []
|
||||
for dependency in self.dependencies:
|
||||
dependency_runner = self.coordinator.RUNNER_DICT[dependency]
|
||||
dependency_runner = self.coordinator.RUNNER_DICT[dependency].cls
|
||||
for setup_name in dependency_runner.setups:
|
||||
dependencie_identifier = self.combine_names(dependency_runner.env_type, setup_name.test_file)
|
||||
results.append(any(dependencie_identifier in f for f in passed_tests))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue