diff options
Diffstat (limited to 'numpy/lib/tests/test__datasource.py')
-rw-r--r-- | numpy/lib/tests/test__datasource.py | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/numpy/lib/tests/test__datasource.py b/numpy/lib/tests/test__datasource.py index fdd22347d..d3bd88d7f 100644 --- a/numpy/lib/tests/test__datasource.py +++ b/numpy/lib/tests/test__datasource.py @@ -9,14 +9,9 @@ from numpy.testing import ( assert_, assert_equal, assert_raises, assert_warns ) -if sys.version_info[0] >= 3: - import urllib.request as urllib_request - from urllib.parse import urlparse - from urllib.error import URLError -else: - import urllib2 as urllib_request - from urlparse import urlparse - from urllib2 import URLError +import urllib.request as urllib_request +from urllib.parse import urlparse +from urllib.error import URLError def urlopen_stub(url, data=None): @@ -162,24 +157,6 @@ class TestDataSourceOpen: fp.close() assert_equal(magic_line, result) - @pytest.mark.skipif(sys.version_info[0] >= 3, reason="Python 2 only") - def test_Bz2File_text_mode_warning(self): - try: - import bz2 - except ImportError: - # We don't have the bz2 capabilities to test. - pytest.skip() - # Test datasource's internal file_opener for BZip2 files. - filepath = os.path.join(self.tmpdir, 'foobar.txt.bz2') - fp = bz2.BZ2File(filepath, 'w') - fp.write(magic_line) - fp.close() - with assert_warns(RuntimeWarning): - fp = self.ds.open(filepath, 'rt') - result = fp.readline() - fp.close() - assert_equal(magic_line, result) - class TestDataSourceExists: def setup(self): |