8000 In nichols_grid tests: use mplcleanup, and remove plt.clf calls · python-control/python-control@59cd872 · GitHub
[go: up one dir, main page]

Skip to content

Commit 59cd872

Browse files
committed
In nichols_grid tests: use mplcleanup, and remove plt.clf calls
1 parent 71f3b61 commit 59cd872

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

control/tests/nichols_test.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def test_nichols_alias(tsys, mplcleanup):
3030
nichols(tsys, grid=False)
3131

3232

33+
@pytest.mark.usefixtures("mplcleanup")
3334
class TestNicholsGrid:
3435
def test_ax(self):
3536
# check grid is plotted into gca, or specified axis
@@ -47,20 +48,17 @@ def test_ax(self):
4748

4849
def test_cl_phase_label_control(self):
4950
# test label_cl_phases argument
50-
plt.clf()
5151
cl_mag_lines, cl_phase_lines, cl_mag_labels, cl_phase_labels \
5252
= nichols_grid()
5353
assert len(cl_phase_labels) > 0
5454

55-
plt.clf()
5655
cl_mag_lines, cl_phase_lines, cl_mag_labels, cl_phase_labels \
5756
= nichols_grid(label_cl_phases=False)
5857
assert len(cl_phase_labels) == 0
5958

6059

6160
def test_labels_clipped(self):
6261
# regression test: check that contour labels are clipped
63-
plt.clf()
6462
mcontours, ncontours, mlabels, nlabels = nichols_grid()
6563
assert all(ml.get_clip_on() for ml in mlabels)
6664
assert all(nl.get_clip_on() for nl in nlabels)
@@ -69,7 +67,6 @@ def test_labels_clipped(self):
6967
def test_minimal_phase(self):
7068
# regression test: phase extent is minimal
7169
g = tf([1],[1,1]) * tf([1],[1/1, 2*0.1/1, 1])
72-
plt.clf()
7370
nichols(g)
7471
ax = plt.gca()
7572
assert ax.get_xlim()[1] <= 0
@@ -82,13 +79,11 @@ def test_fixed_view(self):
8279
* tf(*pade(0.01, 5)))
8380

8481
# normally a broad axis
85-
plt.clf()
8682
nichols(g)
8783

8884
assert(plt.xlim()[0] == -1440)
8985
assert(plt.ylim()[0] <= -240)
9086

91-
plt.clf()
9287
nichols(g, grid=False)
9388

9489
# zoom in

0 commit comments

Comments
 (0)
0