Handles file locking issues on Windows

Addresses potential test failures on Windows due to locked files during temporary directory cleanup.

Implements `ignore_errors=True` when removing temporary directories to prevent `shutil.rmtree` from failing when files are still locked by the process.
This commit is contained in:
AlexKucera committed 2025-11-02 19:53:46 +01:00
1 parent 9f31b7f768
commit ae575f413c
1 file changed
+3 -1
+3 -1
View File
@@ -16,7 +16,9 @@ def temp_dir():
"""Create a temporary directory that is cleaned up after the test."""
tmp = Path(tempfile.mkdtemp())
yield tmp
shutil.rmtree(tmp)
# On Windows, files may still be locked by the process
# Use ignore_errors to prevent test failures during cleanup
shutil.rmtree(tmp, ignore_errors=True)
@pytest.fixture