@@ -84,19 +84,19 @@ The hash library can be generated with
84
84
``--mpl-generate-hash-library=path_to_file.json ``. The hash library to be used
85
85
can either be specified via the ``--mpl-hash-library= `` command line argument,
86
86
or via the ``hash_library= `` keyword argument to the
87
- ``@pytest.mark.mpl_image_comapre `` decorator.
87
+ ``@pytest.mark.mpl_image_compare `` decorator.
88
88
89
89
90
90
Hybrid Mode: Hashes and Images
91
91
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
92
92
93
93
It is possible to configure both hashes and baseline images. In this scenario
94
- the hashes will be compared first, and the baseline images used if the hash
94
+ the hashes will be compared first, with the baseline images only used if the hash
95
95
comparison fails.
96
96
97
97
This is especially useful if the baseline images are external to the repository
98
- with the tests in , and can be accessed remotely . In this situation if the hashes
99
- match the baseline images wont be retrieved, saving time and bandwidth. Also it
98
+ containing the tests, and are accessed via HTTP . In this situation, if the hashes
99
+ match, the baseline images won't be retrieved, saving time and bandwidth. Also, it
100
100
allows the tests to be modified and the hashes updated to reflect the changes
101
101
without having to modify the external images.
102
102
@@ -111,16 +111,16 @@ against, the tests can be run with::
111
111
112
112
and the tests will pass if the images are the same. If you omit the
113
113
``--mpl `` option, the tests will run but will only check that the code
114
- runs without checking the output images.
114
+ runs, without checking the output images.
115
115
116
116
117
117
Generating a Failure Summary
118
118
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
119
119
120
- By specifying the ``--mpl-generate-summary=html `` CLI argument a HTML summary
120
+ By specifying the ``--mpl-generate-summary=html `` CLI argument, a HTML summary
121
121
page will be generated showing the baseline, diff and result image for each
122
122
failing test. If no baseline images are configured, just the result images will
123
- be displayed.
123
+ be displayed. (See also, the ** Results always ** section below.)
124
124
125
125
Options
126
126
-------
@@ -182,6 +182,24 @@ are run. In addition, if both this option and the ``baseline_dir``
182
182
option in the ``mpl_image_compare `` decorator are used, the one in the
183
183
decorator takes precedence.
184
184
185
+ Results always
186
+ ^^^^^^^^^^^^^^
187
+
188
+ By default, result images are only generated for tests that fail.
189
+ Passing ``--mpl-results-always `` to pytest will force result images
190
+ to be generated for all tests, even for tests that pass.
191
+ If a baseline image exists, a diff image will also be generated.
192
+ All of these images will be shown in the summary (if requested).
193
+
194
+ This option is useful for always *comparing * the result images again
195
+ the baseline images, while only *assessing * the tests against the
196
+ hash library.
197
+ If you only update your baseline images after merging a PR, this
198
+ option means that the generated summary will always show how the
199
+ PR affects the baseline images, with the success status of each
200
+ test (based on the hash library) also shown in the generated
201
+ summary.
202
+
185
203
Base style
186
204
^^^^^^^^^^
187
205
0 commit comments