Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b4251e6

Browse files
authored
Merge pull request #20586 from timhoffm/deprecate-test
API: Deprecate matplotlib.test()
2 parents 2ae73c6 + 77f65e8 commit b4251e6

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
``matplotlib.test()`` is deprecated
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
Run tests using ``pytest`` from the commandline instead. The variable
4+
``matplotlib.default_test_modules`` is only used for ``matplotlib.test()`` and
5+
is thus deprecated as well.
6+
7+
To test an installed copy, be sure to specify both ``matplotlib`` and
8+
``mpl_toolkits`` with ``--pyargs``::
9+
10+
python -m pytest --pyargs matplotlib.tests mpl_toolkits.tests
11+
12+
See :ref:`testing` for more details.

doc/devel/testing.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,6 @@ not need to be installed, but Matplotlib should be)::
5757
pytest lib/matplotlib/tests/test_simplification.py::test_clipping
5858

5959

60-
An alternative implementation that does not look at command line arguments
61-
and works from within Python is to run the tests from the Matplotlib library
62-
function :func:`matplotlib.test`::
63-
64-
import matplotlib
65-
matplotlib.test()
66-
67-
6860
.. _command-line parameters: http://doc.pytest.org/en/latest/usage.html
6961

7062

lib/matplotlib/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,6 +1211,7 @@ def _init_tests():
12111211
"" if ft2font.__freetype_build_type__ == 'local' else "not "))
12121212

12131213

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

0 commit comments

Comments
 (0)