FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix tests following test_non_affine_caching, which was leaving a figure behind by mdboom · Pull Request #943 · matplotlib/matplotlib · GitHub

Repository navigation

Fix tests following test_non_affine_caching, which was leaving a figure behind - #943

Merged
mdboom merged 1 commit into
matplotlib:masterfrom
mdboom:transforms-fix-tests
Jun 12, 2012
Merged

mdboom merged 1 commit into
matplotlib:masterfrom
mdboom:transforms-fix-tests

Conversation

mdboom commented Jun 11, 2012

Copy link
Copy Markdown
Member

Bug introduced by #723.

pelson commented Jun 11, 2012

Copy link
Copy Markdown
Member

Thanks Mike, so that I know for the future, how does this issue manifest itself? Is it that a figure gets left lying around?

mdboom commented Jun 11, 2012

Copy link
Copy Markdown
Member Author

The image comparison tests create any number of figures, and then the testing framework iterates through all active figures and compares them to baseline images. This means that any tests that keep figures open will cause subsequent image comparison tests to fail. We have a decorator "@cleanup" which conveniently clears all figures after a test is run (among other memory-related cleanups).

It's a little cumbersome to have to remember this, but it seems that nose does not allow for a "global" teardown method (at least last time I looked about a year and a half ago).

pelson commented Jun 12, 2012

Copy link
Copy Markdown
Member

I wouldn't know where to go to find this information out. Is is documented anywhere? If not, would you mind adding some? (it doesn't have to be done in this ticket, which has my +1)

mdboom commented Jun 12, 2012

Copy link
Copy Markdown
Member Author

Yeah -- that's not very well documented. It is documented that figures created through pyplot are persistent and need to be forcibly cleared, but it should be added that this is of particular concern in test functions since that can have side effects on other tests. I will add a blurb to the testing documentation about this (and the cleanup decorator) in a future pull request.

1 similar comment

mdboom commented Jun 12, 2012

Copy link
Copy Markdown
Member Author

Yeah -- that's not very well documented. It is documented that figures created through pyplot are persistent and need to be forcibly cleared, but it should be added that this is of particular concern in test functions since that can have side effects on other tests. I will add a blurb to the testing documentation about this (and the cleanup decorator) in a future pull request.

mdboom added a commit that referenced this pull request Jun 12, 2012
Fix tests following test_non_affine_caching, which was leaving a figure behind
mdboom merged commit 9bfc97b into matplotlib:master Jun 12, 2012
mdboom deleted the transforms-fix-tests branch March 3, 2015 18:44
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL