Skip to content

Commit c5a497f

Browse files
committed
remove nose from test_convenience
1 parent 596aad4 commit c5a497f

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

zarr/tests/test_convenience.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import unittest
77

88

9-
from nose.tools import assert_raises
109
import numpy as np
1110
from numpy.testing import assert_array_equal
1211
from numcodecs import Zlib, Adler32
@@ -42,7 +41,7 @@ def test_open_array():
4241
assert z.read_only
4342

4443
# path not found
45-
with assert_raises(ValueError):
44+
with pytest.raises(ValueError):
4645
open('doesnotexist', mode='r')
4746

4847

@@ -69,10 +68,10 @@ def test_open_group():
6968

7069

7170
def test_save_errors():
72-
with assert_raises(ValueError):
71+
with pytest.raises(ValueError):
7372
# no arrays provided
7473
save_group('data/group.zarr')
75-
with assert_raises(ValueError):
74+
with pytest.raises(ValueError):
7675
# no arrays provided
7776
save('data/group.zarr')
7877

@@ -427,7 +426,7 @@ def test_copy_array_skip_initialized(self):
427426
assert not np.all(source['foo/bar/baz'][:] == dest['baz'][:])
428427

429428
if self.dest_h5py:
430-
with assert_raises(ValueError):
429+
with pytest.raises(ValueError):
431430
# not available with copy to h5py
432431
copy(source['foo/bar/baz'], dest, if_exists='skip_initialized')
433432

@@ -575,10 +574,9 @@ def test_logging(self):
575574

576575

577576
try:
578-
import h5py # no qa
579-
have_h5py = True
577+
import h5py
580578
except ImportError: # pragma: no cover
581-
have_h5py = False
579+
h5py = None
582580

583581

584582
def temp_h5f():
@@ -589,7 +587,7 @@ def temp_h5f():
589587
return h5f
590588

591589

592-
@pytest.mark.skipif(not have_h5py, reason='h5py not installed')
590+
@pytest.mark.skipif(h5py is None, reason='h5py not installed')
593591
class TestCopyHDF5ToZarr(TestCopy):
594592

595593
def __init__(self, *args, **kwargs):
@@ -600,7 +598,7 @@ def __init__(self, *args, **kwargs):
600598
self.new_dest = group
601599

602600

603-
@pytest.mark.skipif(not have_h5py, reason='h5py not installed')
601+
@pytest.mark.skipif(h5py is None, reason='h5py not installed')
604602
class TestCopyZarrToHDF5(TestCopy):
605603

606604
def __init__(self, *args, **kwargs):
@@ -611,7 +609,7 @@ def __init__(self, *args, **kwargs):
611609
self.new_dest = temp_h5f
612610

613611

614-
@pytest.mark.skipif(not have_h5py, reason='h5py not installed')
612+
@pytest.mark.skipif(h5py is None, reason='h5py not installed')
615613
class TestCopyHDF5ToHDF5(TestCopy):
616614

617615
def __init__(self, *args, **kwargs):

0 commit comments

Comments
 (0)