Skip to content

Deprecate matplotlib.test() #20586

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions doc/api/next_api_changes/deprecations/20586-TH.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
``matplotlib.test()`` is deprecated
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Run tests using ``pytest`` from the commandline instead. The variable
``matplotlib.default_test_modules`` is only used for ``matplotlib.test()`` and
is thus deprecated as well.

To test an installed copy, be sure to specify both ``matplotlib`` and
``mpl_toolkits`` with ``--pyargs``::

python -m pytest --pyargs matplotlib.tests mpl_toolkits.tests

See :ref:`testing` for more details.
8 changes: 0 additions & 8 deletions doc/devel/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,6 @@ not need to be installed, but Matplotlib should be)::
pytest lib/matplotlib/tests/test_simplification.py::test_clipping


An alternative implementation that does not look at command line arguments
and works from within Python is to run the tests from the Matplotlib library
function :func:`matplotlib.test`::

import matplotlib
matplotlib.test()


.. _command-line parameters: http://doc.pytest.org/en/latest/usage.html


Expand Down
1 change: 1 addition & 0 deletions lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1211,6 +1211,7 @@ def _init_tests():
"" if ft2font.__freetype_build_type__ == 'local' else "not "))


@_api.deprecated("3.5", alternative='pytest')
def test(verbosity=None, coverage=False, **kwargs):
"""Run the matplotlib test suite."""

Expand Down