Raise a meaningful error message in @image_comparison decorator#5518
Raise a meaningful error message in @image_comparison decorator#5518maxalbert wants to merge 2 commits intomatplotlib:masterfrom
Conversation
…ison decorator more user-friendly for projects other than matplotlib.
…he-dark attempt to fix the Travis build with numpy 1.6).
|
That particular issue is a new intermittent png issue that we are still trying to track down. @mdboom Thoughts on just removing this? |
I don't think this has to do with the PNG issue. It has to do with how the path to the test file is automatically determined (which is used to get the name for the output directory). This was always a pain because it would be different in different contexts ( It can probably be removed because it was just a sanity check. I don't think there's any good reason to force the behavior. |
|
Oh -- I see what you meant by the PNG error now. I vote for just removing the assert altogether and not insisting on a special name for the root of the tests. |
|
Thanks for the quick replies! To be honest, now I'm slightly confused which particular issues both of you were referring to and what the desired behaviour is. ;-) Since it sounds like it would be good to remove the assert I presume this PR is obsolete, so feel free to close it and simply apply the desired changes yourselves. (Or let me know how you'd like the PR to be reworked and I can try to give it a shot.) |
|
Could you take a shot at removing it? On Fri, Nov 20, 2015, 02:42 maxalbert notifications@github.com wrote:
|
|
Just to make sure I understand correctly: by "removing it" you mean "removing the requirement that the test needs to be defined in a submodule named |
|
Yes get rid of that requirement. The error in the first commit from Travis is just a random fluke and not related to your changes. |
|
Replaced by #5842. |
This PR makes the use of the
@image_comparisondecorator slightly more user-friendly in projects outside matplotlib. (Previously, anAssertionErrorwith a fairly cryptic error message would be raised if a test that uses the@image_comparisondecorator is not contained in a submodule namedtests.)Btw, is there any specific reason this assertion exists? Why not simply allow the tests to live in any directory?