Skip to content

Pytest 3.8.0 broke some NumPy tests. #3945

@charris

Description

@charris

See numpy/numpy#11895 for comments and https://travis-ci.org/numpy/numpy/jobs/425358526 for failing tests. The tests pass with pytest 3.6.1, but fail with 3.8.0. The failing warning is disabled in the tests by

# 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

But this seems to no longer succeed for parametrized tests. The error message with latest NumPy master is

charris@fc [numpy.git (master)]$ python runtests.py -t numpy/matrixlib/tests/test_defmatrix.py 
Building, see build.log...
Build OK
NumPy version 1.16.0.dev0+b8f3be9
NumPy relaxed strides checking option: True

=============================================================== ERRORS ================================================================
________________ ERROR collecting build/testenv/lib64/python2.7/site-packages/numpy/matrixlib/tests/test_defmatrix.py _________________
numpy/matrixlib/tests/test_defmatrix.py:344: in <module>
    class TestNewScalarIndexing(object):
numpy/matrixlib/tests/test_defmatrix.py:345: in TestNewScalarIndexing
    a = matrix([[1, 2], [3, 4]])
numpy/matrixlib/defmatrix.py:118: in __new__
    PendingDeprecationWarning, stacklevel=2)
E   PendingDeprecationWarning: the matrix subclass is not the recommended way to represent matrices or deal with linear algebra (see https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html). Please adjust your code to use regular ndarray.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1 error in 0.09 seconds

Thanks for submitting an issue!

Here's a quick checklist in what to include:

  • Include a detailed description of the bug or suggestion
  • pip list of the virtual environment you are using
  • pytest and operating system versions
  • Minimal example if possible

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: questiongeneral question, might be closed after 2 weeks of inactivity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions