Skip to content

Commit

Permalink
tests: xfail windows permission errors for remove tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ap-- committed Feb 22, 2024
1 parent c03193d commit 5ceac3c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
16 changes: 14 additions & 2 deletions paquo/tests/test_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@ def project_with_removed_image(removable_svs_small):
_ = qp.add_image(removable_svs_small, image_type=QuPathImageType.BRIGHTFIELD_H_E)
qp.save()
path = qp.path
removable_svs_small.unlink()
try:
removable_svs_small.unlink()
except PermissionError:
if platform.system() == "Windows":
pytest.xfail("Windows QuPath==0.5.0 permission issue")
else:
raise
yield path


Expand All @@ -47,7 +53,13 @@ def project_with_removed_image_without_image_data(removable_svs_small):
_ = qp.add_image(removable_svs_small)
qp.save()
path = qp.path
removable_svs_small.unlink()
try:
removable_svs_small.unlink()
except PermissionError:
if platform.system() == "Windows":
pytest.xfail("Windows QuPath==0.5.0 permission issue")
else:
raise
yield path


Expand Down
8 changes: 7 additions & 1 deletion paquo/tests/test_projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,13 @@ def test_project_image_uri_update_try_relative(tmp_path, svs_small):

# NOW move the location
location_1 = tmp_path / "location_1"
shutil.move(location_0, location_1)
try:
shutil.move(location_0, location_1)
except PermissionError:
if platform.system() == "Windows":
pytest.xfail("Windows QuPath==0.5.0 quirk with permissions")
else:
raise

with QuPathProject(location_1 / "project", mode='r') as qp:
entry, = qp.images
Expand Down

0 comments on commit 5ceac3c

Please sign in to comment.