Skip to content
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

Various test improvements #1887

Merged
merged 8 commits into from
Sep 24, 2021
Merged

Various test improvements #1887

merged 8 commits into from
Sep 24, 2021

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Sep 23, 2021

See commits for details:

  • Remove unnecessary ImageTesting usage
  • Remove unnecessary plt.close in tests
  • Reduce plt usage in tests
  • Remove ExampleImageTesting
  • Use pytest.warns in tests
  • Parametrize ticker tests more
  • Replace CallCounter by mock patching
  • Report all test result types on CI

This was used for the side effect of changing the backend to Agg, but
that is done automatically by the autouse pytest fixture.
All figures are closed automatically by the `mpl_test_cleanup` fixture.
@QuLogic QuLogic added this to the 0.21 milestone Sep 23, 2021
When we already have a Figure or Axes, then use that directly. Also, if
multiple subplots are created, then make a figure (if there wasn't one)
to create those on.
There are no `plt.show` calls made in the tests that need to be
overridden as in this class.
Also, shorten some existing parametrizations.
Copy link
Contributor

@greglucas greglucas left a comment

Choose a reason for hiding this comment

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

Looks like a nice cleanup to me. Just a minor comment/question about consistency.

lib/cartopy/tests/mpl/test_axes.py Outdated Show resolved Hide resolved
lib/cartopy/tests/mpl/test_caching.py Outdated Show resolved Hide resolved
@greglucas greglucas merged commit 13cdb76 into SciTools:master Sep 24, 2021
@QuLogic QuLogic deleted the test-cleanup branch September 24, 2021 01:00
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