diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2018-09-06 13:17:12 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2018-09-06 16:52:20 -0600 |
commit | 3f111a429195c3b892240bb22a67e39cf2230bdd (patch) | |
tree | c48ea9bd35cc6e4e4983e6c29be262a8cd635e47 /numpy/matrixlib/tests/test_multiarray.py | |
parent | b8f3be9e35bf81dfdd595cf99d3ec28a84d5fec7 (diff) | |
download | numpy-3f111a429195c3b892240bb22a67e39cf2230bdd.tar.gz |
BUG: Fix matrix PendingDeprecationWarning suppression for pytest 3.8+.
Pytest < 3.8 ignored warnings issued during test collection, but that
changed in pytest 3.8 and the method NumPy used to suppress the
PendingDeprecationWarning for matrices no longer worked, or rather, was
exposed as not working. The fix here is to suppress the warning in
pytest.ini and pytesttester.py , which should work as long as the tests
are the only places left where NumPy uses matrices.
An alternate fix is to delay the construction of matrices in the tests
until they are actually run, which has the virtue of test localization
but is a bit more complicated.
See https://github.com/pytest-dev/pytest/issues/3945 for discussion.
Diffstat (limited to 'numpy/matrixlib/tests/test_multiarray.py')
-rw-r--r-- | numpy/matrixlib/tests/test_multiarray.py | 8 |
1 files changed, 1 insertions, 7 deletions
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 |