Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9007556

Browse filesBrowse files
committed
Describe how to test regular installations of Matplotlib
1 parent 1eef019 commit 9007556
Copy full SHA for 9007556

File tree

Expand file treeCollapse file tree

2 files changed

+45
-20
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+45
-20
lines changed

‎INSTALL.rst

Copy file name to clipboardExpand all lines: INSTALL.rst
-20Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -38,26 +38,6 @@ Although not required, we suggest also installing ``IPython`` for
3838
interactive use. To easily install a complete Scientific Python
3939
stack, see :ref:`install_scipy_dists` below.
4040

41-
Test data
42-
---------
43-
44-
The wheels (:file:`*.whl`) on the `PyPI download page
45-
<https://pypi.org/project/matplotlib/>`_ do not contain test data
46-
or example code.
47-
48-
If you want to try the many demos that come in the Matplotlib source
49-
distribution, download the :file:`*.tar.gz` file and look in the
50-
:file:`examples` subdirectory.
51-
52-
To run the test suite:
53-
54-
* extract the :file:`lib/matplotlib/tests` or :file:`lib/mpl_toolkits/tests`
55-
directories from the source distribution.
56-
* install test dependencies: `pytest <https://pypi.org/project/pytest>`_,
57-
MiKTeX, GhostScript, ffmpeg, avconv, ImageMagick, and `Inkscape
58-
<https://inkscape.org/>`_.
59-
* run ``python -mpytest``.
60-
6141
Third-party distributions of Matplotlib
6242
=======================================
6343

‎doc/devel/testing.rst

Copy file name to clipboardExpand all lines: doc/devel/testing.rst
+45Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,3 +225,48 @@ you may (rarely) need to build very old versions of Matplotlib. The following
225225
constraints need to be taken into account:
226226

227227
- Matplotlib 1.3 (or earlier) requires numpy 1.8 (or earlier).
228+
229+
Testing released versions of Matplotlib
230+
---------------------------------------
231+
Running the tests on an installation of a released version (e.g. PyPI package
232+
or conda package) also requires additional setup.
233+
234+
.. note::
235+
236+
For an end-user, there is usually no need to run the tests on released
237+
versions of Matplotlib. Official releases are tested before publishing.
238+
239+
Install additional dependencies
240+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
241+
Install the :ref:`additional dependencies for testing <test-dependencies>`.
242+
243+
Obtain the reference images
244+
^^^^^^^^^^^^^^^^^^^^^^^^^^^
245+
Many tests compare the plot result against reference images. The reference
246+
images are not part of the regular packaged versions (pip wheels or conda
247+
packages). If you want to run tests with reference images, you need to obtain
248+
the reference images matching the version of Matplotlib you want to test.
249+
250+
To do so, either download the matching source distribution
251+
``matplotlib-X.Y.Z.tar.gz`` from `PyPI <https://pypi.org/project/matplotlib/>`_
252+
or alternatively, clone the git repository and ``git checkout vX.Y.Z``. Copy
253+
the folder :file:`lib/matplotlib/tests/baseline_images` to the folder
254+
:file:`matplotlib/tests` of your the matplotlib installation to test.
255+
The correct target folder can be found using::
256+
257+
python -c "import matplotlib.tests; print(matplotlib.tests.__file__.rsplit('/', 1)[0])"
258+
259+
An analogous copying of :file:`lib/mpl_toolkits/tests/baseline_images`
260+
is necessary for testing the :ref:`toolkits`.
261+
262+
Run the tests
263+
^^^^^^^^^^^^^
264+
To run the all the tests on your installed version of Matplotlib::
265+
266+
pytest --pyargs matplotlib.tests
267+
268+
The test discovery scope can be narrowed to single test modules or even single
269+
functions::
270+
271+
pytest --pyargs matplotlib.tests.test_simplification.py::test_clipping
272+

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.