Directly check if two figures returned by a function are equal#95
Draft
weiji14 wants to merge 4 commits intomatplotlib:mainfrom
Draft
Directly check if two figures returned by a function are equal#95weiji14 wants to merge 4 commits intomatplotlib:mainfrom
weiji14 wants to merge 4 commits intomatplotlib:mainfrom
Conversation
50aa147 to
6855db9
Compare
Also added test to check that the skipping works, and test for unequal images too.
Contributor
|
I like option 1 above. I haven't reviewed the implementation in detail, but I like the concept in general. |
Author
|
Hiya, I've actually ended up implementing Option 2 in this PR since it was easier (and more explicit), and also because I couldn't work out how to have two different marks ( |
This was referenced Mar 16, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Check two figures (generated using slightly different methods) returned by a test function directly, similar to matplotlib's check_figures_equal function. Open to suggestions on names and implementation details.
Option 1
Original idea which is to follow matplotlib's style (see https://matplotlib.org/3.3.1/api/testing_api.html#matplotlib.testing.decorators.check_figures_equal):
Option 2
Probably easier to implement, and we can reuse the same
@pytest.mark.mpl_image_comparedecorator, but there might be compatibility issues from some users?Option 3?
Some mix of the above two? Maybe another alternative solution?
Will resolve #94