diff --git a/tiled/_tests/test_directory_walker.py b/tiled/_tests/test_directory_walker.py index f9c0be682..86dd2209c 100644 --- a/tiled/_tests/test_directory_walker.py +++ b/tiled/_tests/test_directory_walker.py @@ -1,5 +1,4 @@ import platform -import time from pathlib import Path import pytest @@ -24,6 +23,11 @@ def example_data_dir(tmpdir_factory): return tmpdir +@pytest.mark.xfail( + platform.system() == "Windows", + reason="file cannot be removed while being used", + raises=PermissionError, +) @pytest.mark.asyncio async def test_collision(example_data_dir, tmpdir): """Test that files which produce key collisions are ignored until the collision is resolved.""" @@ -40,12 +44,6 @@ async def test_collision(example_data_dir, tmpdir): # And omits the colliding entries. assert "a" not in client - # Windows will fail to unlink the file, below, if it is still being used: - # PermissionError: [WinError 32] The process cannot access the file because - # it is being used by another process: '...' - if platform.system() == "Windows": - time.sleep(5) - # Resolve the collision. p.unlink()