TST: Clean up figure tests #7765

Merged
merged 2 commits into from Jan 11, 2017

Conversation

Projects
None yet
5 participants
Contributor

dstansby commented Jan 8, 2017

Add a couple of @cleanup decorators, and catch a newish warning. This gets rid of a couple of warnings from the tests.

@dstansby dstansby Clean up figure test
b6cea4e

dstansby changed the title from Clean up figure test to Clean up figure tests Jan 8, 2017

tacaswell added this to the 2.1 (next point release) milestone Jan 8, 2017

tacaswell added the Testing label Jan 8, 2017

tacaswell changed the title from Clean up figure tests to [MRG+1] TST: Clean up figure tests Jan 8, 2017

@@ -83,7 +84,10 @@ def test_gca():
# the final request for a polar axes will end up creating one
# with a spec of 111.
- assert_true(fig.gca(polar=True) is not ax3)
+ with warnings.catch_warnings(record=True) as w:
@QuLogic

QuLogic Jan 8, 2017

Member

Within this context, you also need a warnings.simplefilter('always') or else the warning may not be triggered.

lib/matplotlib/tests/test_figure.py
@@ -205,6 +208,7 @@ def test_axes_remove():
assert_equal(len(fig.axes), 3)
+@cleanup
@QuLogic

QuLogic Jan 8, 2017

Member

Contrary to its documentation, plt.figaspect doesn't actually create a new figure, so this shouldn't affect anything.

@dstansby dstansby Small figure testing fixes
8de6aab

Current coverage is 62.12% (diff: 100%)

Merging #7765 into master will not change coverage

@@             master      #7765   diff @@
==========================================
  Files           174        174          
  Lines         56028      56028          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits          34805      34805          
  Misses        21223      21223          
  Partials          0          0          

Powered by Codecov. Last update 115bade...8de6aab

@NelleV

NelleV approved these changes Jan 11, 2017

Thanks!

@NelleV NelleV merged commit 3f7dad4 into matplotlib:master Jan 11, 2017

5 checks passed

codecov/patch Coverage not affected when comparing 115bade...8de6aab
Details
codecov/project 62.12% (+0.00%) compared to 115bade
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 62.121%
Details

QuLogic changed the title from [MRG+1] TST: Clean up figure tests to TST: Clean up figure tests Jan 15, 2017

dstansby deleted the dstansby:figure-test-clean branch Jan 22, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment