| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Introduce a single private `_cleanup_cm` contextmanager and use it to implement `CleanupTestCase` and `@cleanup`. Use `warnings.catch_warnings` to avoid completely destroying a preexisting warnings filter, instead just restoring the filter that existed before the test started. Use `matplotlib.style.context` to restore the style at exit, as it relies on rc_context which is ultimately more efficient than `rcParams.update` as it skips revalidation. Deprecate CleanupTest (and implement it in terms of CleanupTestCase), as it is clearly a nose-oriented base class that could have been deprecated at the same time as ImageComparisonTest.
Otherwise, rcParams cannot be deprecated without spamming stderr with one warning per test.
|
@efiring @tacaswell This PR fixes the warnings issue (and more generally makes it possible, among other things, to deprecate rcParams without jumping through hoops to avoid the same issue arising again). |
Sorry, something went wrong.
|
Thank you. All this arcane testing machinery is beyond my knowledge and abilities, but I'm glad to see that it kills the spam. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Introduce a single private _cleanup_cm contextmanager and use it to
implement CleanupTestCase and @cleanup.
Use warnings.catch_warnings to avoid completely destroying a
preexisting warnings filter, instead just restoring the filter that
existed before the test started.
Use matplotlib.style.context to restore the style at exit, as it
relies on rc_context which is ultimately more efficient than
rcParams.update as it skips revalidation.
Deprecate CleanupTest (and implement it in terms of CleanupTestCase), as
it is clearly a nose-oriented base class that could have been deprecated
at the same time as ImageComparisonTest.
PR Summary
PR Checklist