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_format.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_format.py')
-rw-r--r-- | numpy/lib/tests/test_format.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/numpy/lib/tests/test_format.py b/numpy/lib/tests/test_format.py index af64dd043..3185e32ac 100644 --- a/numpy/lib/tests/test_format.py +++ b/numpy/lib/tests/test_format.py @@ -287,7 +287,7 @@ from io import BytesIO import numpy as np from numpy.testing import ( assert_, assert_array_equal, assert_raises, assert_raises_regex, - raises, SkipTest + raises ) from numpy.lib import format @@ -807,7 +807,7 @@ def test_bad_header(): def test_large_file_support(): if (sys.platform == 'win32' or sys.platform == 'cygwin'): - raise SkipTest("Unknown if Windows has sparse filesystems") + pytest.skip("Unknown if Windows has sparse filesystems") # try creating a large sparse file tf_name = os.path.join(tempdir, 'sparse_file') try: @@ -817,7 +817,7 @@ def test_large_file_support(): import subprocess as sp sp.check_call(["truncate", "-s", "5368709120", tf_name]) except Exception: - raise SkipTest("Could not create 5GB large file") + pytest.skip("Could not create 5GB large file") # write a small array to the end with open(tf_name, "wb") as f: f.seek(5368709120) @@ -839,7 +839,7 @@ def test_large_archive(): try: a = np.empty((2**30, 2), dtype=np.uint8) except MemoryError: - raise SkipTest("Could not create large file") + pytest.skip("Could not create large file") fname = os.path.join(tempdir, "large_archive") |