Skip to content

Commit

Permalink
io tests: use skipUnless, not skipIf(not...)
Browse files Browse the repository at this point in the history
  • Loading branch information
clbarnes committed Nov 13, 2019
1 parent 0bd3298 commit 20befdc
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/io_tests/test_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,42 +54,42 @@ def test_is_group(self):
self.assertFalse(is_group(ds))


@unittest.skipIf(h5py is None, "Need h5py")
@unittest.skipUnless(h5py, "Need h5py")
class TestH5pyFiles(FileTestBase, FileTestMixin):
ext = ".h5"
constructor = getattr(h5py, "File", None)


@unittest.skipIf(z5py is None, "Need z5py")
@unittest.skipUnless(z5py, "Need z5py")
class TestZ5pyN5Files(FileTestBase, FileTestMixin):
ext = ".n5"
constructor = getattr(z5py, "N5File", None)


@unittest.skipIf(z5py is None, "Need z5py")
@unittest.skipUnless(z5py, "Need z5py")
class TestZ5pyZarrFiles(FileTestBase, FileTestMixin):
ext = ".zr"
constructor = getattr(z5py, "ZarrFile", None)


@unittest.skipIf(pyn5 is None, "Need pyn5")
@unittest.skipUnless(pyn5, "Need pyn5")
class TestPyn5Files(FileTestBase, FileTestMixin):
ext = ".n5"
constructor = getattr(pyn5, "File", None)


@unittest.skipIf(zarr is None, "Need zarr")
@unittest.skipUnless(zarr, "Need zarr")
class TestZarrFiles(FileTestBase, FileTestMixin):
ext = ".zr"
constructor = getattr(zarr, "open", None)


class TestBackendPreference(unittest.TestCase):
@unittest.skipIf(z5py is None and zarr is None, "Need z5py and zarr")
@unittest.skipUnless(z5py and zarr, "Need z5py and zarr")
def test_z5py_over_zarr(self):
self.assertTrue(issubclass(FILE_CONSTRUCTORS[".n5"], z5py.File))

@unittest.skipIf(z5py is None and pyn5 is None, "Need z5py and pyn5")
@unittest.skipUnless(z5py and pyn5, "Need z5py and pyn5")
def test_z5py_over_pyn5(self):
self.assertTrue(issubclass(FILE_CONSTRUCTORS[".zr"], z5py.File))

Expand Down

0 comments on commit 20befdc

Please sign in to comment.