diff options
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/_pytesttester.py | 18 | ||||
-rw-r--r-- | numpy/matrixlib/tests/test_defmatrix.py | 8 | ||||
-rw-r--r-- | numpy/matrixlib/tests/test_interaction.py | 8 | ||||
-rw-r--r-- | numpy/matrixlib/tests/test_masked_matrix.py | 9 | ||||
-rw-r--r-- | numpy/matrixlib/tests/test_matrix_linalg.py | 8 | ||||
-rw-r--r-- | numpy/matrixlib/tests/test_multiarray.py | 8 | ||||
-rw-r--r-- | numpy/matrixlib/tests/test_numeric.py | 8 | ||||
-rw-r--r-- | numpy/matrixlib/tests/test_regression.py | 8 |
8 files changed, 25 insertions, 50 deletions
diff --git a/numpy/_pytesttester.py b/numpy/_pytesttester.py index 6a1b3274e..30ecc69c7 100644 --- a/numpy/_pytesttester.py +++ b/numpy/_pytesttester.py @@ -160,6 +160,24 @@ class PytestTester(object): "-W ignore::UserWarning:cpuinfo", ] + # When testing matrices, ignore their PendingDeprecationWarnings + pytest_args += [ + "-W ignore:the matrix subclass is not", + ] + + # Ignore python2.7 -3 warnings + pytest_args += [ + r"-W ignore:sys\.exc_clear\(\) not supported in 3\.x:DeprecationWarning", + r"-W ignore:in 3\.x, __setslice__:DeprecationWarning", + r"-W ignore:in 3\.x, __getslice__:DeprecationWarning", + r"-W ignore:buffer\(\) not supported in 3\.x:DeprecationWarning", + r"-W ignore:CObject type is not supported in 3\.x:DeprecationWarning", + r"-W ignore:comparing unequal types not supported in 3\.x:DeprecationWarning", + r"-W ignore:the commands module has been removed in Python 3\.0:DeprecationWarning", + r"-W ignore:The 'new' module has been removed in Python 3\.0:DeprecationWarning", + ] + + if doctests: raise ValueError("Doctests not supported") diff --git a/numpy/matrixlib/tests/test_defmatrix.py b/numpy/matrixlib/tests/test_defmatrix.py index 272cd8d52..4cff5ee9b 100644 --- a/numpy/matrixlib/tests/test_defmatrix.py +++ b/numpy/matrixlib/tests/test_defmatrix.py @@ -1,12 +1,6 @@ from __future__ import division, absolute_import, print_function -# As we are testing matrices, we ignore its PendingDeprecationWarnings -try: - import pytest - pytestmark = pytest.mark.filterwarnings( - 'ignore:the matrix subclass is not:PendingDeprecationWarning') -except ImportError: - pass +import pytest try: # Accessing collections abstract classes from collections diff --git a/numpy/matrixlib/tests/test_interaction.py b/numpy/matrixlib/tests/test_interaction.py index fb4d8f98c..088ae3c6a 100644 --- a/numpy/matrixlib/tests/test_interaction.py +++ b/numpy/matrixlib/tests/test_interaction.py @@ -4,13 +4,7 @@ Note that tests with MaskedArray and linalg are done in separate files. """ from __future__ import division, absolute_import, print_function -# As we are testing matrices, we ignore its PendingDeprecationWarnings -try: - import pytest - pytestmark = pytest.mark.filterwarnings( - 'ignore:the matrix subclass is not:PendingDeprecationWarning') -except ImportError: - pass +import pytest import textwrap import warnings diff --git a/numpy/matrixlib/tests/test_masked_matrix.py b/numpy/matrixlib/tests/test_masked_matrix.py index adc2e5419..5ed8044aa 100644 --- a/numpy/matrixlib/tests/test_masked_matrix.py +++ b/numpy/matrixlib/tests/test_masked_matrix.py @@ -1,14 +1,7 @@ from __future__ import division, absolute_import, print_function -# As we are testing matrices, we ignore its PendingDeprecationWarnings -try: - import pytest - pytestmark = pytest.mark.filterwarnings( - 'ignore:the matrix subclass is not:PendingDeprecationWarning') -except ImportError: - pass - import pickle +import pytest import numpy as np from numpy.ma.testutils import (assert_, assert_equal, assert_raises, diff --git a/numpy/matrixlib/tests/test_matrix_linalg.py b/numpy/matrixlib/tests/test_matrix_linalg.py index 85c7693b4..8d31ec5b0 100644 --- a/numpy/matrixlib/tests/test_matrix_linalg.py +++ b/numpy/matrixlib/tests/test_matrix_linalg.py @@ -1,13 +1,7 @@ """ Test functions for linalg module using the matrix class.""" from __future__ import division, absolute_import, print_function -# As we are testing matrices, we ignore its PendingDeprecationWarnings -try: - import pytest - pytestmark = pytest.mark.filterwarnings( - 'ignore:the matrix subclass is not:PendingDeprecationWarning') -except ImportError: - pass +import pytest import numpy as np diff --git a/numpy/matrixlib/tests/test_multiarray.py b/numpy/matrixlib/tests/test_multiarray.py index 2f04b49d6..8de0a7c6a 100644 --- a/numpy/matrixlib/tests/test_multiarray.py +++ b/numpy/matrixlib/tests/test_multiarray.py @@ -1,12 +1,6 @@ from __future__ import division, absolute_import, print_function -# As we are testing matrices, we ignore its PendingDeprecationWarnings -try: - import pytest - pytestmark = pytest.mark.filterwarnings( - 'ignore:the matrix subclass is not:PendingDeprecationWarning') -except ImportError: - pass +import pytest import numpy as np from numpy.testing import assert_, assert_equal, assert_array_equal diff --git a/numpy/matrixlib/tests/test_numeric.py b/numpy/matrixlib/tests/test_numeric.py index cfdada126..e9f44e747 100644 --- a/numpy/matrixlib/tests/test_numeric.py +++ b/numpy/matrixlib/tests/test_numeric.py @@ -1,12 +1,6 @@ from __future__ import division, absolute_import, print_function -# As we are testing matrices, we ignore its PendingDeprecationWarnings -try: - import pytest - pytestmark = pytest.mark.filterwarnings( - 'ignore:the matrix subclass is not:PendingDeprecationWarning') -except ImportError: - pass +import pytest import numpy as np from numpy.testing import assert_equal diff --git a/numpy/matrixlib/tests/test_regression.py b/numpy/matrixlib/tests/test_regression.py index 439704ccf..88654c76a 100644 --- a/numpy/matrixlib/tests/test_regression.py +++ b/numpy/matrixlib/tests/test_regression.py @@ -1,12 +1,6 @@ from __future__ import division, absolute_import, print_function -# As we are testing matrices, we ignore its PendingDeprecationWarnings -try: - import pytest - pytestmark = pytest.mark.filterwarnings( - 'ignore:the matrix subclass is not:PendingDeprecationWarning') -except ImportError: - pass +import pytest import numpy as np from numpy.testing import assert_, assert_equal, assert_raises |