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