Skip to content

Commit

Permalink
tests: adjust remove image fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
ap-- committed Feb 22, 2024
1 parent 09d58b2 commit c03193d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions paquo/tests/test_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,21 @@ def removable_svs_small(svs_small):
@pytest.fixture(scope='function')
def project_with_removed_image(removable_svs_small):
with tempfile.TemporaryDirectory(prefix='paquo-') as tmpdir:
qp = QuPathProject(tmpdir, mode='x')
_ = qp.add_image(removable_svs_small, image_type=QuPathImageType.BRIGHTFIELD_H_E)
qp.save()
with QuPathProject(tmpdir, mode='x') as qp:
_ = qp.add_image(removable_svs_small, image_type=QuPathImageType.BRIGHTFIELD_H_E)
qp.save()
path = qp.path
removable_svs_small.unlink()
yield qp.path
yield path


@pytest.fixture(scope='function')
def project_with_removed_image_without_image_data(removable_svs_small):
with tempfile.TemporaryDirectory(prefix='paquo-') as tmpdir:
qp = QuPathProject(tmpdir, mode='x')
_ = qp.add_image(removable_svs_small)
qp.save()
path = qp.path
del qp
with QuPathProject(tmpdir, mode='x') as qp:
_ = qp.add_image(removable_svs_small)
qp.save()
path = qp.path
removable_svs_small.unlink()
yield path

Expand Down

0 comments on commit c03193d

Please sign in to comment.