summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2018-04-24 21:51:23 -0700
committerEric Wieser <wieser.eric@gmail.com>2018-04-24 21:52:43 -0700
commit4ec8930f0b60d7fff059d0f005ed2a0efbf41fb7 (patch)
tree4974cb20fd264a57bf069c5c2ac8bf8d319a7be3 /numpy
parent58e40ce3f270a84faa45ff29bcbce5dfea2a0e74 (diff)
downloadnumpy-4ec8930f0b60d7fff059d0f005ed2a0efbf41fb7.tar.gz
MAINT: Pull repeated decorators up to their containing class
Diffstat (limited to 'numpy')
-rw-r--r--numpy/tests/test_ctypeslib.py21
1 files changed, 9 insertions, 12 deletions
diff --git a/numpy/tests/test_ctypeslib.py b/numpy/tests/test_ctypeslib.py
index 725d868d7..fd4336fad 100644
--- a/numpy/tests/test_ctypeslib.py
+++ b/numpy/tests/test_ctypeslib.py
@@ -21,11 +21,12 @@ try:
except ImportError:
_HAS_CTYPE = False
+
+@pytest.mark.skipif(not _HAS_CTYPE,
+ reason="ctypes not available in this python")
+@pytest.mark.skipif(sys.platform == 'cygwin',
+ reason="Known to fail on cygwin")
class TestLoadLibrary(object):
- @pytest.mark.skipif(not _HAS_CTYPE,
- reason="ctypes not available in this python")
- @pytest.mark.skipif(sys.platform == 'cygwin',
- reason="Known to fail on cygwin")
def test_basic(self):
try:
# Should succeed
@@ -35,10 +36,6 @@ class TestLoadLibrary(object):
" (import error was: %s)" % str(e))
print(msg)
- @pytest.mark.skipif(not _HAS_CTYPE,
- reason="ctypes not available in this python")
- @pytest.mark.skipif(sys.platform == 'cygwin',
- reason="Known to fail on cygwin")
def test_basic2(self):
# Regression for #801: load_library with a full library name
# (including extension) does not work.
@@ -54,6 +51,7 @@ class TestLoadLibrary(object):
" (import error was: %s)" % str(e))
print(msg)
+
class TestNdpointer(object):
def test_dtype(self):
dt = np.intc
@@ -114,9 +112,10 @@ class TestNdpointer(object):
a2 = ndpointer(dtype=np.float64)
assert_(a1 == a2)
+
+@pytest.mark.skipif(not _HAS_CTYPE,
+ reason="ctypes not available on this python installation")
class TestAsArray(object):
- @pytest.mark.skipif(not _HAS_CTYPE,
- reason="ctypes not available on this python installation")
def test_array(self):
from ctypes import c_int
at = c_int * 2
@@ -127,8 +126,6 @@ class TestAsArray(object):
assert_equal(a.shape, (3, 2))
assert_array_equal(a, np.array([[1, 2], [3, 4], [5, 6]]))
- @pytest.mark.skipif(not _HAS_CTYPE,
- reason="ctypes not available on this python installation")
def test_pointer(self):
from ctypes import c_int, cast, POINTER
p = cast((c_int * 10)(*range(10)), POINTER(c_int))