diff options
author | Tyler Reddy <tyler.je.reddy@gmail.com> | 2018-09-21 13:56:16 -0700 |
---|---|---|
committer | Tyler Reddy <tyler.je.reddy@gmail.com> | 2018-09-21 13:56:16 -0700 |
commit | f531cfd97a99ac8b534fff479e3388888319a606 (patch) | |
tree | 3572ba8e8571d203b8dcb1c9e0f6501937223ea0 /numpy/lib/tests/test__datasource.py | |
parent | 6f0a0fafdd0b315cb46fca553beaff769af6e0da (diff) | |
download | numpy-f531cfd97a99ac8b534fff479e3388888319a606.tar.gz |
TST: prefer pytest.skip() over SkipTest
* replace most usage of SkipTest() with
pytest.skip()
* where possible, we avoid use of the standard
library SkipTest because unittest skipping
is routed through the pytest nose compatibility
layer in that scenario, which can prevent an easy
trace back to the test line where the skip
occurred
Diffstat (limited to 'numpy/lib/tests/test__datasource.py')
-rw-r--r-- | numpy/lib/tests/test__datasource.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/numpy/lib/tests/test__datasource.py b/numpy/lib/tests/test__datasource.py index 85788941c..1df8bebf6 100644 --- a/numpy/lib/tests/test__datasource.py +++ b/numpy/lib/tests/test__datasource.py @@ -8,7 +8,7 @@ from shutil import rmtree import numpy.lib._datasource as datasource from numpy.testing import ( - assert_, assert_equal, assert_raises, assert_warns, SkipTest + assert_, assert_equal, assert_raises, assert_warns ) if sys.version_info[0] >= 3: @@ -137,7 +137,7 @@ class TestDataSourceOpen(object): import gzip except ImportError: # We don't have the gzip capabilities to test. - raise SkipTest + pytest.skip() # Test datasource's internal file_opener for Gzip files. filepath = os.path.join(self.tmpdir, 'foobar.txt.gz') fp = gzip.open(filepath, 'w') @@ -153,7 +153,7 @@ class TestDataSourceOpen(object): import bz2 except ImportError: # We don't have the bz2 capabilities to test. - raise SkipTest + 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') @@ -170,7 +170,7 @@ class TestDataSourceOpen(object): import bz2 except ImportError: # We don't have the bz2 capabilities to test. - raise SkipTest + 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') |