Skip to content

Commit 4170f93

Browse files
Remove some redundant PY2 test specialisations.
1 parent 2b091fa commit 4170f93

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

numcodecs/tests/test_vlen_array.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import pytest
88

99

10-
from numcodecs.compat import PY2
1110
try:
1211
from numcodecs.vlen import VLenArray
1312
except ImportError: # pragma: no cover
@@ -78,8 +77,7 @@ def test_decode_errors():
7877
codec.decode(np.arange(2, 3, dtype='i4'))
7978
with pytest.raises(ValueError):
8079
codec.decode(np.arange(10, 20, dtype='i4'))
81-
with pytest.raises(ValueError if PY2 else TypeError):
82-
# exports old-style buffer interface on PY2, hence ValueError
80+
with pytest.raises(TypeError):
8381
codec.decode(u'foo')
8482

8583
# test out parameter

numcodecs/tests/test_vlen_bytes.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import pytest
88

99

10-
from numcodecs.compat import PY2
1110
try:
1211
from numcodecs.vlen import VLenBytes
1312
except ImportError: # pragma: no cover
@@ -69,8 +68,7 @@ def test_decode_errors():
6968
codec.decode(np.arange(2, 3, dtype='i4'))
7069
with pytest.raises(ValueError):
7170
codec.decode(np.arange(10, 20, dtype='i4'))
72-
with pytest.raises(ValueError if PY2 else TypeError):
73-
# exports old-style buffer interface on PY2, hence ValueError
71+
with pytest.raises(TypeError):
7472
codec.decode(u'foo')
7573

7674
# test out parameter

numcodecs/tests/test_vlen_utf8.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import pytest
88

99

10-
from numcodecs.compat import PY2
1110
try:
1211
from numcodecs.vlen import VLenUTF8
1312
except ImportError: # pragma: no cover
@@ -65,8 +64,7 @@ def test_decode_errors():
6564
codec.decode(np.arange(2, 3, dtype='i4'))
6665
with pytest.raises(ValueError):
6766
codec.decode(np.arange(10, 20, dtype='i4'))
68-
with pytest.raises(ValueError if PY2 else TypeError):
69-
# exports old-style buffer interface on PY2, hence ValueError
67+
with pytest.raises(TypeError):
7068
codec.decode(u'foo')
7169

7270
# test out parameter

0 commit comments

Comments
 (0)