Skip to content

Commit da1d766

Browse files
authored
Merge pull request matplotlib#27471 from story645/visualize-tests
Doc: visualizing_tests and `triage_tests` tools
2 parents a2a2809 + eaa6262 commit da1d766

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

doc/devel/testing.rst

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,23 @@ not need to be installed, but Matplotlib should be)::
5959

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

62+
Viewing image test output
63+
^^^^^^^^^^^^^^^^^^^^^^^^^
64+
65+
The output of :ref:`image-based <image-comparison>` tests is stored in a
66+
``result_images`` directory. These images can be compiled into one HTML page, containing
67+
hundreds of images, using the ``visualize_tests`` tool::
68+
69+
python tools/visualize_tests.py
70+
71+
Image test failures can also be analysed using the ``triage_tests`` tool::
72+
73+
python tools/triage_tests.py
74+
75+
The triage tool allows you to accept or reject test failures and will copy the new image
76+
to the folder where the baseline test images are stored. The triage tool requires that
77+
:ref:`QT <backend_dependencies>` is installed.
78+
6279

6380
Writing a simple test
6481
---------------------
@@ -94,7 +111,9 @@ For numpy's default random number generator use::
94111

95112
and then use ``rng`` when generating the random numbers.
96113

97-
The seed is John Hunter's birthday.
114+
The seed is :ref:`John Hunter's <project_history>` birthday.
115+
116+
.. _image-comparison:
98117

99118
Writing an image comparison test
100119
--------------------------------
@@ -128,6 +147,10 @@ texts (labels, tick labels, etc) are not really part of what is tested, use
128147
``remove_text=True`` as this will lead to smaller figures and reduce possible
129148
issues with font mismatch on different platforms.
130149

150+
151+
Compare two methods of creating an image
152+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
153+
131154
Baseline images take a lot of space in the Matplotlib repository.
132155
An alternative approach for image comparison tests is to use the
133156
`~matplotlib.testing.decorators.check_figures_equal` decorator, which should be

doc/users/installing/dependencies.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ Optional
4141
The following packages and tools are not required but extend the capabilities
4242
of Matplotlib.
4343

44+
.. _backend_dependencies:
45+
4446
Backends
4547
^^^^^^^^
4648

0 commit comments

Comments
 (0)