From ae575f413c78a59c5c72a2ba7a9f9348b9f6054c Mon Sep 17 00:00:00 2001 From: Alexander Kucera Date: Sun, 2 Nov 2025 19:53:46 +0100 Subject: [PATCH] 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. --- tests/conftest.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 720aefd..fe3b1da 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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