diff options
author | Seth Troisi <sethtroisi@google.com> | 2020-01-08 23:49:17 -0800 |
---|---|---|
committer | Seth Troisi <sethtroisi@google.com> | 2020-01-15 13:19:56 -0800 |
commit | 1427484e9015e73b7017ee9336ce914a6f15187b (patch) | |
tree | 2db89078addee6a01697ab8bd4160c25d59fffc4 /numpy/lib/tests/test_io.py | |
parent | b6bc0941d4f07310456079ab2497c3d1bde4a5e7 (diff) | |
download | numpy-1427484e9015e73b7017ee9336ce914a6f15187b.tar.gz |
MAINT: Remove sys.version checks in tests
Diffstat (limited to 'numpy/lib/tests/test_io.py')
-rw-r--r-- | numpy/lib/tests/test_io.py | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py index ba27eea6c..6460741b5 100644 --- a/numpy/lib/tests/test_io.py +++ b/numpy/lib/tests/test_io.py @@ -44,7 +44,6 @@ class TextIO(BytesIO): BytesIO.writelines(self, [asbytes(s) for s in lines]) -MAJVER, MINVER = sys.version_info[:2] IS_64BIT = sys.maxsize > 2**32 try: import bz2 @@ -528,12 +527,10 @@ class TestSaveTxt: a = np.array([utf8], dtype=np.unicode_) # our gz wrapper support encoding suffixes = ['', '.gz'] - # stdlib 2 versions do not support encoding - if MAJVER > 2: - if HAS_BZ2: - suffixes.append('.bz2') - if HAS_LZMA: - suffixes.extend(['.xz', '.lzma']) + if HAS_BZ2: + suffixes.append('.bz2') + if HAS_LZMA: + suffixes.extend(['.xz', '.lzma']) with tempdir() as tmpdir: for suffix in suffixes: np.savetxt(os.path.join(tmpdir, 'test.csv' + suffix), a, @@ -599,18 +596,14 @@ class LoadTxtBase: res = self.loadfunc(f) assert_array_equal(res, wanted) - # Python2 .open does not support encoding - @pytest.mark.skipif(MAJVER == 2, reason="Needs Python version >= 3") def test_compressed_gzip(self): self.check_compressed(gzip.open, ('.gz',)) @pytest.mark.skipif(not HAS_BZ2, reason="Needs bz2") - @pytest.mark.skipif(MAJVER == 2, reason="Needs Python version >= 3") def test_compressed_bz2(self): self.check_compressed(bz2.open, ('.bz2',)) @pytest.mark.skipif(not HAS_LZMA, reason="Needs lzma") - @pytest.mark.skipif(MAJVER == 2, reason="Needs Python version >= 3") def test_compressed_lzma(self): self.check_compressed(lzma.open, ('.xz', '.lzma')) |