@@ -75,8 +75,8 @@ directly in the right directory.
7575With a Hash Library
7676^^^^^^^^^^^^^^^^^^^
7777
78- Instead of comparing to baseline images, you can instead compare against a json
79- library of sha256 hashes. This has the advantage of not having to check baseline
78+ Instead of comparing to baseline images, you can instead compare against a JSON
79+ library of SHA-256 hashes. This has the advantage of not having to check baseline
8080images into the repository with the tests, or download them from a remote
8181source.
8282
@@ -91,8 +91,11 @@ Hybrid Mode: Hashes and Images
9191^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9292
9393It is possible to configure both hashes and baseline images. In this scenario
94- the hashes will be compared first, with the baseline images only used if the hash
95- comparison fails.
94+ only the hash comparison can determine the test result. If the hash comparison
95+ fails, the test will fail, however a comparison to the baseline image will be
96+ carried out so the actual difference can be seen. If the hash comparison passes,
97+ the comparison to the baseline image is skipped (unless **results always ** is
98+ configured).
9699
97100This is especially useful if the baseline images are external to the repository
98101containing the tests, and are accessed via HTTP. In this situation, if the hashes
@@ -104,7 +107,7 @@ without having to modify the external images.
104107Running Tests
105108^^^^^^^^^^^^^
106109
107- Once tests are written with either baseline images or a hash library to compare
110+ Once tests are written with baseline images, a hash library, or both to compare
108111against, the tests can be run with::
109112
110113 pytest --mpl
@@ -118,12 +121,15 @@ Generating a Test Summary
118121^^^^^^^^^^^^^^^^^^^^^^^^^
119122
120123By specifying the ``--mpl-generate-summary=html `` CLI argument, a HTML summary
121- page will be generated showing the result, log entry and RMS of each test,
122- and the hashes if configured. The baseline, diff and result image for each
123- failing test will be shown. If **Results always ** is configured
124- (see section below), images for passing tests will also be shown.
125- If no baseline images are configured, just the result images will
126- be displayed.
124+ page will be generated showing the test result, log entry and generated result
125+ image. When in the (default) image comparison mode, the baseline image, diff
126+ image and RMS (if any), and tolerance of each test will also be shown.
127+ When in the hash comparison mode, the baseline hash and result hash will
128+ also be shown. When in hybrid mode, all of these are included.
129+
130+ When generating a HTML summary, the ``--mpl-results-always `` option is
131+ automatically applied (see section below). Therefore images for passing
132+ tests will also be shown.
127133
128134+---------------+---------------+---------------+
129135| |html all | | |html filter | | |html result | |
@@ -199,20 +205,25 @@ decorator takes precedence.
199205Results always
200206^^^^^^^^^^^^^^
201207
202- By default, result images are only generated for tests that fail.
208+ By default, result images are only saved for tests that fail.
203209Passing ``--mpl-results-always `` to pytest will force result images
204- to be generated for all tests, even for tests that pass.
205- If a baseline image exists, a diff image will also be generated.
206- All of these images will be shown in the summary (if requested).
210+ to be saved for all tests, even for tests that pass.
211+
212+ When in **hybrid mode **, even if a test passes hash comparison,
213+ a comparison to the baseline image will also be carried out,
214+ with the baseline image and diff image (if image comparison fails)
215+ saved for all tests. This secondary comparison will not affect
216+ the success status of the test.
207217
208- This option is useful for always *comparing * the result images again
218+ This option is useful for always *comparing * the result images against
209219the baseline images, while only *assessing * the tests against the
210220hash library.
211221If you only update your baseline images after merging a PR, this
212222option means that the generated summary will always show how the
213223PR affects the baseline images, with the success status of each
214224test (based on the hash library) also shown in the generated
215- summary.
225+ summary. This option is applied automatically when generating
226+ a HTML summary.
216227
217228Base style
218229^^^^^^^^^^
0 commit comments