Skip to content

Commit bc8108b

Browse files
committed
Fixes for some issues
1 parent 1dce0de commit bc8108b

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

docs/configuration.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ File containing baseline hashes
196196
197197
The file containing the baseline hashes that will be compared to the test figures.
198198
Both the kwarg option (``hash_library``) and the CLI option (``--mpl-hash-library``) are relative to the test file.
199+
In this case, the CLI option takes precedence over the kwarg option.
199200
The file must be a JSON file in the same format as one generated by ``--mpl-generate-hash-library``.
200201
If its directory does not exist, it will be created along with any missing parent directories.
201202

docs/usage.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,16 @@ Even through the figure has changed, the test will pass, because image compariso
108108
If ``pytest-mpl`` is not installed, the image comparison tests will cause pytest to show a warning, ``PytestReturnNotNoneWarning``.
109109
Installing pytest-mpl will solve this issue.
110110
When ``pytest-mpl`` is installed but not enabled, it will intercept the returned figure and close it without doing any comparison.
111+
111112
Alternatively, the image comparison tests can be deselected by running pytest with ``-m "not mpl_image_compare"``.
113+
Or the following can be included in your test functions to skip if ``pytest-mpl`` is not installed:
114+
115+
.. code-block:: python
116+
117+
@pytest.mark.mpl_image_compare
118+
def test_plot():
119+
pytest.importorskip("pytest_mpl")
120+
...
112121
113122
.. rubric:: Tests can fail when Matplotlib and FreeType versions change
114123

0 commit comments

Comments
 (0)