tests: use updated conftest from pymplate, this allows to run individual test modules properly

e.g. pytest --pyargs my.core.tests.test_get_files
This commit is contained in:
Dima Gerasimov 2024-08-06 20:41:50 +01:00 committed by karlicoss
parent b615ba10b1
commit 3aebc573e8
2 changed files with 54 additions and 2 deletions

View file

@ -175,12 +175,17 @@ TMP = tempfile.gettempdir()
test_path = Path(TMP) / 'hpi_test'
def setup():
@pytest.fixture(autouse=True)
def prepare():
teardown()
test_path.mkdir()
try:
yield
finally:
teardown()
def teardown():
def teardown() -> None:
if test_path.is_dir():
shutil.rmtree(test_path)