Skip to content

Commit

Permalink
xfail collision test on Windows (#542)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielballan authored Aug 5, 2023
1 parent 9d278ae commit e33f873
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions tiled/_tests/test_directory_walker.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import platform
import time
from pathlib import Path

import pytest
Expand All @@ -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."""
Expand All @@ -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()

Expand Down

0 comments on commit e33f873

Please sign in to comment.