@@ -30,6 +30,7 @@ def test_nichols_alias(tsys, mplcleanup):
30
30
nichols (tsys , grid = False )
31
31
32
32
33
+ @pytest .mark .usefixtures ("mplcleanup" )
33
34
class TestNicholsGrid :
34
35
def test_ax (self ):
35
36
# check grid is plotted into gca, or specified axis
@@ -47,20 +48,17 @@ def test_ax(self):
47
48
48
49
def test_cl_phase_label_control (self ):
49
50
# test label_cl_phases argument
50
- plt .clf ()
51
51
cl_mag_lines , cl_phase_lines , cl_mag_labels , cl_phase_labels \
52
52
= nichols_grid ()
53
53
assert len (cl_phase_labels ) > 0
54
54
55
- plt .clf ()
56
55
cl_mag_lines , cl_phase_lines , cl_mag_labels , cl_phase_labels \
57
56
= nichols_grid (label_cl_phases = False )
58
57
assert len (cl_phase_labels ) == 0
59
58
60
59
61
60
def test_labels_clipped (self ):
62
61
# regression test: check that contour labels are clipped
63
- plt .clf ()
64
62
mcontours , ncontours , mlabels , nlabels = nichols_grid ()
65
63
assert all (ml .get_clip_on () for ml in mlabels )
66
64
assert all (nl .get_clip_on () for nl in nlabels )
@@ -69,7 +67,6 @@ def test_labels_clipped(self):
69
67
def test_minimal_phase (self ):
70
68
# regression test: phase extent is minimal
71
69
g = tf ([1 ],[1 ,1 ]) * tf ([1 ],[1 / 1 , 2 * 0.1 / 1 , 1 ])
72
- plt .clf ()
73
70
nichols (g )
74
71
ax = plt .gca ()
75
72
assert ax .get_xlim ()[1 ] <= 0
@@ -82,13 +79,11 @@ def test_fixed_view(self):
82
79
* tf (* pade (0.01 , 5 )))
83
80
84
81
# normally a broad axis
85
- plt .clf ()
86
82
nichols (g )
87
83
88
84
assert (plt .xlim ()[0 ] == - 1440 )
89
85
assert (plt .ylim ()[0 ] <= - 240 )
90
86
91
- plt .clf ()
92
87
nichols (g , grid = False )
93
88
94
89
# zoom in
0 commit comments