summaryrefslogtreecommitdiff
path: root/numpy/linalg/tests
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2018-04-06 18:03:31 -0600
committerGitHub <noreply@github.com>2018-04-06 18:03:31 -0600
commit036151143bff1eebeded5582534e676a192352cd (patch)
tree8bc070f39accd6241c05c923b1364cafc4e0f700 /numpy/linalg/tests
parent70c060dfdab9e0c31eeec248ed40c26d3555033c (diff)
parentfedcb3d1276f7f9ff92ef260ac1bfa6b31690742 (diff)
downloadnumpy-036151143bff1eebeded5582534e676a192352cd.tar.gz
Merge pull request #10842 from charris/switch-to-pytest
TST: Switch to pytest
Diffstat (limited to 'numpy/linalg/tests')
-rw-r--r--numpy/linalg/tests/test_build.py10
-rw-r--r--numpy/linalg/tests/test_linalg.py17
2 files changed, 15 insertions, 12 deletions
diff --git a/numpy/linalg/tests/test_build.py b/numpy/linalg/tests/test_build.py
index b46a72c02..2e9eb7389 100644
--- a/numpy/linalg/tests/test_build.py
+++ b/numpy/linalg/tests/test_build.py
@@ -3,9 +3,10 @@ from __future__ import division, absolute_import, print_function
from subprocess import PIPE, Popen
import sys
import re
+import pytest
from numpy.linalg import lapack_lite
-from numpy.testing import run_module_suite, assert_, dec
+from numpy.testing import run_module_suite, assert_
class FindDependenciesLdd(object):
@@ -42,8 +43,8 @@ class FindDependenciesLdd(object):
class TestF77Mismatch(object):
- @dec.skipif(not(sys.platform[:5] == 'linux'),
- "Skipping fortran compiler mismatch on non Linux platform")
+ @pytest.mark.skipif(not(sys.platform[:5] == 'linux'),
+ reason="no fortran compiler on non-Linux platform")
def test_lapack(self):
f = FindDependenciesLdd()
deps = f.grep_dependencies(lapack_lite.__file__,
@@ -53,5 +54,6 @@ class TestF77Mismatch(object):
cause random crashes and wrong results. See numpy INSTALL.txt for more
information.""")
-if __name__ == "__main__":
+
+if __name__ == '__main__':
run_module_suite()
diff --git a/numpy/linalg/tests/test_linalg.py b/numpy/linalg/tests/test_linalg.py
index 8372679be..c0147ab64 100644
--- a/numpy/linalg/tests/test_linalg.py
+++ b/numpy/linalg/tests/test_linalg.py
@@ -8,6 +8,7 @@ import sys
import itertools
import traceback
import warnings
+import pytest
import numpy as np
from numpy import array, single, double, csingle, cdouble, dot, identity
@@ -18,8 +19,8 @@ from numpy.linalg.linalg import _multi_dot_matrix_chain_order
from numpy.testing import (
assert_, assert_equal, assert_raises, assert_array_equal,
assert_almost_equal, assert_allclose, run_module_suite,
- dec, SkipTest, suppress_warnings
-)
+ SkipTest, suppress_warnings
+ )
def ifthen(a, b):
@@ -388,35 +389,35 @@ class HermitianTestCase(object):
class LinalgGeneralizedSquareTestCase(object):
- @dec.slow
+ @pytest.mark.slow
def test_generalized_sq_cases(self):
_check_cases(self.do, require={'generalized', 'square'}, exclude={'size-0'})
- @dec.slow
+ @pytest.mark.slow
def test_generalized_empty_sq_cases(self):
_check_cases(self.do, require={'generalized', 'square', 'size-0'})
class LinalgGeneralizedNonsquareTestCase(object):
- @dec.slow
+ @pytest.mark.slow
def test_generalized_nonsq_cases(self):
_check_cases(self.do, require={'generalized', 'nonsquare'}, exclude={'size-0'})
- @dec.slow
+ @pytest.mark.slow
def test_generalized_empty_nonsq_cases(self):
_check_cases(self.do, require={'generalized', 'nonsquare', 'size-0'})
class HermitianGeneralizedTestCase(object):
- @dec.slow
+ @pytest.mark.slow
def test_generalized_herm_cases(self):
_check_cases(self.do,
require={'generalized', 'hermitian'},
exclude={'size-0'})
- @dec.slow
+ @pytest.mark.slow
def test_generalized_empty_herm_cases(self):
_check_cases(self.do,
require={'generalized', 'hermitian', 'size-0'},