Skip to content

Commit a792086

Browse files
committed
Use nodeid instead of name to identify test
This fixes a race condition caused by multiple tests with the same name in different files using the same cache directory
1 parent 5a2241f commit a792086

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tests/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ def with_test_cache(test_files_directory, request):
291291
f"Cannot find test cache dir, expected it to be {test_files_directory!s}!",
292292
)
293293
_root_cache_directory = openml.config._root_cache_directory
294-
tmp_cache = test_files_directory / request.node.name
294+
tmp_cache = test_files_directory / request.node.nodeid.replace("/", ".").replace("::", ".")
295295
openml.config.set_root_cache_directory(tmp_cache)
296296
yield
297297
openml.config.set_root_cache_directory(_root_cache_directory)
@@ -308,4 +308,4 @@ def workdir(tmp_path):
308308
original_cwd = Path.cwd()
309309
os.chdir(tmp_path)
310310
yield tmp_path
311-
os.chdir(original_cwd)
311+
os.chdir(original_cwd)

0 commit comments

Comments
 (0)