Skip to content

Commit ebc7781

Browse files
committed
Earlier tests cleanup to save space
1 parent 7e8c260 commit ebc7781

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

tests/test_singularity_containers.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,20 @@
77
import spikeinterface.sorters as ss
88

99

10-
@pytest.fixture
11-
def work_dir(request, tmpdir_factory):
12-
tmpdir = tmpdir_factory.mktemp("work_dir")
13-
os.chdir(tmpdir)
10+
@pytest.fixture(autouse=True)
11+
def work_dir(request, tmp_path):
12+
"""
13+
This fixture, along with "run_kwargs" creates one folder per
14+
test function using built-in tmp_path pytest fixture
15+
16+
The tmp_path will be the working directory for the test function
17+
18+
At the end of the each test function, a clean up will be done
19+
"""
20+
os.chdir(tmp_path)
1421
yield
1522
os.chdir(request.config.invocation_dir)
16-
shutil.rmtree(str(tmpdir))
23+
shutil.rmtree(str(tmp_path))
1724

1825

1926
@pytest.fixture

0 commit comments

Comments
 (0)