Skip to content

Commit e4dc50b

Browse files
authored
Merge pull request #101 from Cadair/hash_results_summary
Implement Hybrid Mode and Image Summary
2 parents 7524344 + 10b661a commit e4dc50b

File tree

8 files changed

+280
-68
lines changed

8 files changed

+280
-68
lines changed

.github/workflows/python-package.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ jobs:
4343
- os: ubuntu-latest
4444
python-version: 3.8
4545
toxenv: py38-test-mpl31
46+
- os: ubuntu-latest
47+
python-version: 3.7
48+
toxenv: py37-test-mpl32
49+
- os: ubuntu-latest
50+
python-version: 3.8
51+
toxenv: py38-test-mpl33
4652
# Code style checks
4753
- os: ubuntu-latest
4854
python-version: 3.8

README.rst

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ If the directory does not exist, it will be created. The directory will
7171
be interpreted as being relative to where you are running ``pytest``.
7272
Once you are happy with the generated images, you should move them to a
7373
sub-directory called ``baseline`` relative to the test files (this name
74-
is configurable, see below). You can also generate the baseline images
74+
is configurable, see below). You can also generate the baseline image
7575
directly in the right directory.
7676

7777
With a Hash Library
@@ -89,6 +89,20 @@ or via the ``hash_library=`` keyword argument to the
8989
``@pytest.mark.mpl_image_comapre`` decorator.
9090

9191

92+
Hybrid Mode: Hashes and Images
93+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
94+
95+
It is possible to configure both hashes and baseline images. In this scenario
96+
the hashes will be compared first, and the baseline images used if the hash
97+
comparison fails.
98+
99+
This is especially useful if the baseline images are external to the repository
100+
with the tests in, and can be accessed remotely. In this situation if the hashes
101+
match the baseline images wont be retrieved, saving time and bandwidth. Also it
102+
allows the tests to be modified and the hashes updated to reflect the changes
103+
without having to modify the external images.
104+
105+
92106
Running Tests
93107
^^^^^^^^^^^^^
94108

@@ -101,6 +115,15 @@ and the tests will pass if the images are the same. If you omit the
101115
``--mpl`` option, the tests will run but will only check that the code
102116
runs without checking the output images.
103117

118+
119+
Generating a Failure Summary
120+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
121+
122+
By specifying the ``--mpl-generate-summary=html`` CLI argument a HTML summary
123+
page will be generated showing the baseline, diff and result image for each
124+
failing test. If no baseline images are configured, just the result images will
125+
be displayed.
126+
104127
Options
105128
-------
106129

0 commit comments

Comments
 (0)