Skip to content

Commit bfb3fe9

Browse files
committed
Only use either Pytest or TestBase cache directory, not both
1 parent 0b3184e commit bfb3fe9

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

tests/conftest.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,13 @@ def with_server(request):
286286

287287
@pytest.fixture(autouse=True)
288288
def with_test_cache(test_files_directory, request):
289+
# Skip this fixture for TestBase subclasses - they manage their own cache directory
290+
# in setUp()/tearDown(). Having both mechanisms fight over the global config
291+
# causes race conditions.
292+
if request.instance is not None and isinstance(request.instance, TestBase):
293+
yield
294+
return
295+
289296
if not test_files_directory.exists():
290297
raise ValueError(
291298
f"Cannot find test cache dir, expected it to be {test_files_directory!s}!",

0 commit comments

Comments
 (0)