summaryrefslogtreecommitdiff
path: root/numpy/f2py/tests
diff options
context:
space:
mode:
authorTyler Reddy <tyler.je.reddy@gmail.com>2018-09-21 13:56:16 -0700
committerTyler Reddy <tyler.je.reddy@gmail.com>2018-09-21 13:56:16 -0700
commitf531cfd97a99ac8b534fff479e3388888319a606 (patch)
tree3572ba8e8571d203b8dcb1c9e0f6501937223ea0 /numpy/f2py/tests
parent6f0a0fafdd0b315cb46fca553beaff769af6e0da (diff)
downloadnumpy-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/f2py/tests')
-rw-r--r--numpy/f2py/tests/test_array_from_pyobj.py4
-rw-r--r--numpy/f2py/tests/util.py10
2 files changed, 7 insertions, 7 deletions
diff --git a/numpy/f2py/tests/test_array_from_pyobj.py b/numpy/f2py/tests/test_array_from_pyobj.py
index 8b021491f..310af339a 100644
--- a/numpy/f2py/tests/test_array_from_pyobj.py
+++ b/numpy/f2py/tests/test_array_from_pyobj.py
@@ -8,7 +8,7 @@ import copy
from numpy import (
array, alltrue, ndarray, zeros, dtype, intp, clongdouble
)
-from numpy.testing import assert_, assert_equal, SkipTest
+from numpy.testing import assert_, assert_equal
from numpy.core.multiarray import typeinfo
from . import util
@@ -24,7 +24,7 @@ def setup_module():
# Check compiler availability first
if not util.has_c_compiler():
- raise SkipTest("No C compiler available")
+ pytest.skip("No C compiler available")
if wrap is None:
config_code = """
diff --git a/numpy/f2py/tests/util.py b/numpy/f2py/tests/util.py
index 466fd4970..73fc27b96 100644
--- a/numpy/f2py/tests/util.py
+++ b/numpy/f2py/tests/util.py
@@ -20,7 +20,7 @@ import pytest
import numpy.f2py
from numpy.compat import asbytes, asstr
-from numpy.testing import SkipTest, temppath
+from numpy.testing import temppath
from importlib import import_module
try:
@@ -322,14 +322,14 @@ class F2PyTest(object):
def setup(self):
if sys.platform == 'win32':
- raise SkipTest('Fails with MinGW64 Gfortran (Issue #9673)')
+ pytest.skip('Fails with MinGW64 Gfortran (Issue #9673)')
if self.module is not None:
return
# Check compiler availability first
if not has_c_compiler():
- raise SkipTest("No C compiler available")
+ pytest.skip("No C compiler available")
codes = []
if self.sources:
@@ -345,9 +345,9 @@ class F2PyTest(object):
elif fn.endswith('.f90'):
needs_f90 = True
if needs_f77 and not has_f77_compiler():
- raise SkipTest("No Fortran 77 compiler available")
+ pytest.skip("No Fortran 77 compiler available")
if needs_f90 and not has_f90_compiler():
- raise SkipTest("No Fortran 90 compiler available")
+ pytest.skip("No Fortran 90 compiler available")
# Build the module
if self.code is not None: