Skip to content

Commit 07047c7

Browse files
authored
Merge pull request #76 from amoodie/master
Add info to `pytest.fail` `msg` when image not found, to indicate `baseline_dir` where plugin was looking
2 parents 68c2df0 + dbed117 commit 07047c7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pytest_mpl/plugin.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,10 @@ def item_function_wrapper(*args, **kwargs):
262262
baseline_image_ref = os.path.abspath(os.path.join(os.path.dirname(item.fspath.strpath), baseline_dir, filename))
263263

264264
if not os.path.exists(baseline_image_ref):
265-
pytest.fail("Image file not found for comparison test. "
266-
"(This is expected for new tests.)\nGenerated Image: "
267-
"\n\t{test}".format(test=test_image), pytrace=False)
265+
pytest.fail("Image file not found for comparison test in: "
266+
"\n\t{baseline_dir}"
267+
"\n(This is expected for new tests.)\nGenerated Image: "
268+
"\n\t{test}".format(baseline_dir=baseline_dir, test=test_image), pytrace=False)
268269

269270
# distutils may put the baseline images in non-accessible places,
270271
# copy to our tmpdir to be sure to keep them in case of failure

0 commit comments

Comments
 (0)