File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 10
10
from matplotlib .axes import Axes
11
11
import matplotlib .pyplot as plt
12
12
import numpy as np
13
+ import warnings
13
14
14
15
15
16
@cleanup
@@ -83,7 +84,11 @@ def test_gca():
83
84
84
85
# the final request for a polar axes will end up creating one
85
86
# with a spec of 111.
86
- assert_true (fig .gca (polar = True ) is not ax3 )
87
+ with warnings .catch_warnings (record = True ) as w :
88
+ warnings .simplefilter ('always' )
89
+ # Changing the projection will throw a warning
90
+ assert_true (fig .gca (polar = True ) is not ax3 )
91
+ assert len (w ) == 1
87
92
assert_true (fig .gca (polar = True ) is not ax2 )
88
93
assert_equal (fig .gca ().get_geometry (), (1 , 1 , 1 ))
89
94
@@ -133,15 +138,14 @@ def test_alpha():
133
138
134
139
@cleanup
135
140
def test_too_many_figures ():
136
- import warnings
137
-
138
141
with warnings .catch_warnings (record = True ) as w :
139
142
warnings .simplefilter ("always" )
140
143
for i in range (rcParams ['figure.max_open_warning' ] + 1 ):
141
144
fig = plt .figure ()
142
145
assert len (w ) == 1
143
146
144
147
148
+ @cleanup
145
149
def test_iterability_axes_argument ():
146
150
147
151
# This is a regression test for matplotlib/matplotlib#3196. If one of the
You can’t perform that action at this time.
0 commit comments