Skip to content

image_comparison decorator refactor #7097

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

Kojoley
Copy link
Member

@Kojoley Kojoley commented Sep 12, 2016

It is now function based, what removes the need of pytest workaround. On pytest it uses mark.parametrize instead of a generator, what makes collection phase lightning fast and significantly reduces number of generators usages and corresponding deprecation warnings. (generators are deprecated since pytest 3.0 and will be removed in 4.0)

Note: There is a bug in Nose related to GeneratorExit exception handling in setup fixture of a function. It is workarounded in image_comparison decorator, but you will see this line in such case in the log: RuntimeError: generator ignored GeneratorExit

@Kojoley Kojoley force-pushed the refactor-image_comparison-decorator branch from aabee2a to f8efcfc Compare September 12, 2016 21:04
@tacaswell
Copy link
Member

How does this relate to https://github.com/matplotlib/pytest-mpl ?

@Kojoley
Copy link
Member Author

Kojoley commented Sep 13, 2016

Currently pytest-mpl does not support multiple extensions and multiple figures/baselines. I have some thoughts about how it should be handled (for example one possibility is to use yield fig in image comparison tests), but it is not the main priority, while long collection phase is something that annoys me a lot and slowdowns development.

@tacaswell
Copy link
Member

I opened a PR against your branch to fix the scatter issue in a different way. That should have been creating two identical figures, instead it was over-plotting.

Kojoley and others added 7 commits September 16, 2016 13:25
It is now function based, what removes the need of pytest workaround.
On pytest it uses `mark.parametrize` instead of a generator, what makes
collection phase lightning fast and significantly reduces number of generators
usages and corresponding deprecation warnings.
(generators are deprecated since pytest 3.0 and will be removed in 4.0)

Note: There is a bug in Nose related to `GeneratorExit` exception handling
in `setup` fixture of a function. It is workarounded in `image_comparison`
decorator, but you will see this line in such case in the log:
`RuntimeError: generator ignored GeneratorExit`
Should create two identical figures to exercise data kwarg
@Kojoley Kojoley force-pushed the refactor-image_comparison-decorator branch from af2e816 to 909194b Compare September 16, 2016 10:34
Copy link
Member

@NelleV NelleV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the difference between the old scatter.png and the new one?

@Kojoley
Copy link
Member Author

Kojoley commented Sep 20, 2016

The discussion and diff image is here Kojoley#1

@tacaswell
Copy link
Member

I am going to merge this as-is because the failure on appveyor is pgf related and was not caused by this PR.

@tacaswell tacaswell merged commit 431be66 into matplotlib:master Sep 20, 2016
@QuLogic QuLogic added this to the 2.1 (next point release) milestone Sep 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants