Add info to pytest.fail
msg
when image not found, to indicate baseline_dir
where plugin was looking
#76
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Really simple change to
pytest.fail
msg
for when the plugin fails to find the image atbaseline_dir
. I'm new to the plugin, and when attempting to use, I struggled for longer than I'd like to admit as to why the test could not find my image.My
baseline_dir
was located in mytests
folder alongside thetest_figs.py
test file, as the instructions indicate to do after generating the baseline figures. The instructions also say (on my re-reading now) that the folder is "interpreted as being relative to the test file," but I foolishly was defining@pytest.mark.mpl_image_compare(baseline_dir='tests/figs_baseline')
.Anyway, I only figured this out by modifying my installed version of pytest-mpl to determine where the plugin was searching. I'm not sure if anyone else follows my stupidity, but this would be a simple debugging tool for new users. Also might be helpful to add some emphasis to the README in this vein? Or a simple project structure example like below?
where
figure_maker.py
is a script or module that producesfig1
andfig2
during normal use.Anyway, great plugin/utility, thanks!
AM