Skip to content
Snippets Groups Projects
Commit 995c2911 authored by lukas leufen's avatar lukas leufen
Browse files

added conftest.py for a better cleanup

parent 0f569572
No related branches found
No related tags found
2 merge requests!24include recent development,!20not distributed training
Pipeline #27086 passed
import os
import shutil
import pytest
@pytest.fixture(autouse=True, scope='class')
def teardown_module(pytestconfig):
yield
# dirname can be found at pytestconfig._assertstate.hook.session._initialparts[0][0].dirname but it is not clear for
# me, if there can be more than 1 entry in each of the lists. Therefore just loop over all elements will definitely
# catch all dirnames.
d = pytestconfig._assertstate.hook.session._initialparts
for di in d:
for dii in di:
if "data" in os.listdir(dii.dirname):
shutil.rmtree(os.path.join(dii.dirname, "data"), ignore_errors=True)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment