remove subdir fixtures

This commit is contained in:
Daniel 2023-11-27 14:25:31 +01:00
parent a2718084bc
commit d67f56bce7

View file

@ -31,7 +31,16 @@ def pytest_addoption(parser):
@pytest.fixture(scope="session", autouse=True) @pytest.fixture(scope="session", autouse=True)
def dirmanager(request) -> DirManager: def DIR(request) -> DirManager:
"""Fixture holding test directories
DIR.OUTPUT
DIR.SESSION
DIR.RECORDS
DIR.STATES
DIR.RESULTS
DIR.PROGRESS"""
output_dir = request.config.getoption("--output_dir") output_dir = request.config.getoption("--output_dir")
assert output_dir is not None, "required pytest command line argument not given" assert output_dir is not None, "required pytest command line argument not given"
output_dir = Path(output_dir) output_dir = Path(output_dir)
@ -51,22 +60,6 @@ def dotenv_config(request) -> dict[str, str]:
return dotenv_values(dotenv_path) # type: ignore return dotenv_values(dotenv_path) # type: ignore
@pytest.fixture(scope="session", autouse=True)
def RECORDS(dirmanager) -> Path:
assert isinstance(dirmanager, DirManager)
return dirmanager.RECORDS
@pytest.fixture(scope="session", autouse=True)
def STATES(dirmanager) -> Path:
return dirmanager.STATES
@pytest.fixture(scope="session", autouse=True)
def RESULTS(dirmanager) -> Path:
return dirmanager.RESULTS
@pytest.hookimpl(tryfirst=True, hookwrapper=True) @pytest.hookimpl(tryfirst=True, hookwrapper=True)
def pytest_runtest_makereport(item, call): def pytest_runtest_makereport(item, call):
"""saves traceback when test fails""" """saves traceback when test fails"""