diff --git a/napari_ome_zarr/_tests/test_reader.py b/napari_ome_zarr/_tests/test_reader.py index 4c2d957..235c104 100644 --- a/napari_ome_zarr/_tests/test_reader.py +++ b/napari_ome_zarr/_tests/test_reader.py @@ -1,4 +1,5 @@ import sys +from pathlib import Path import numpy as np import pytest @@ -9,11 +10,14 @@ class TestNapari: @pytest.fixture(autouse=True) - def initdir(self, tmpdir): - self.path_3d = tmpdir.mkdir("data_3d") - create_zarr(str(self.path_3d), astronaut, "astronaut") - self.path_2d = tmpdir.mkdir("data_2d") - create_zarr(str(self.path_2d)) + def initdir(self, tmp_path: Path): + self.path_3d = tmp_path / "data_3d" + self.path_3d.mkdir() + create_zarr(self.path_3d, astronaut, "astronaut") + + self.path_2d = tmp_path / "data_2d" + self.path_2d.mkdir() + create_zarr(self.path_2d) def test_get_reader_hit(self): reader = napari_get_reader(str(self.path_3d)) @@ -81,12 +85,12 @@ def test_image(self, path): self.assert_layers(layers, True, False, path) def test_labels(self): - filename = str(self.path_3d.join("labels")) + filename = self.path_2d / "labels" layers = napari_get_reader(filename)() self.assert_layers(layers, False, True) def test_label(self): - filename = str(self.path_3d.join("labels", "astronaut")) + filename = self.path_3d / "labels" / "astronaut" layers = napari_get_reader(filename)() self.assert_layers(layers, False, True)