Skip to content

Commit 4a4d088

Browse files
committed
mplcleanup for all nyquist tests
1 parent 38d6909 commit 4a4d088

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

control/tests/nyquist_test.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010

1111
import pytest
1212
import numpy as np
13-
import scipy as sp
1413
import matplotlib.pyplot as plt
1514
import control as ct
1615

16+
pytestmark = pytest.mark.usefixtures("mplcleanup")
17+
1718

1819
# Utility function for counting unstable poles of open loop (P in FBS)
1920
def _P(sys, indent='right'):
@@ -34,7 +35,6 @@ def _Z(sys):
3435

3536

3637
# Basic tests
37-
@pytest.mark.usefixtures("mplcleanup")
3838
def test_nyquist_basic():
3939
# Simple Nyquist plot
4040
sys = ct.rss(5, 1, 1)
@@ -109,7 +109,6 @@ def test_nyquist_basic():
109109

110110

111111
# Some FBS examples, for comparison
112-
@pytest.mark.usefixtures("mplcleanup")
113112
def test_nyquist_fbs_examples():
114113
s = ct.tf('s')
115114

@@ -151,7 +150,6 @@ def test_nyquist_fbs_examples():
151150
1, 2, 3, 4, # specified number of arrows
152151
[0.1, 0.5, 0.9], # specify arc lengths
153152
])
154-
@pytest.mark.usefixtures("mplcleanup")
155153
def test_nyquist_arrows(arrows):
156154
sys = ct.tf([1.4], [1, 2, 1]) * ct.tf(*ct.pade(1, 4))
157155
plt.figure();
@@ -160,7 +158,6 @@ def test_nyquist_arrows(arrows):
160158
assert _Z(sys) == count + _P(sys)
161159

162160

163-
@pytest.mark.usefixtures("mplcleanup")
164161
def test_nyquist_encirclements():
165162
# Example 14.14: effect of friction in a cart-pendulum system
166163
s = ct.tf('s')
@@ -185,7 +182,6 @@ def test_nyquist_encirclements():
185182
assert _Z(sys) == count + _P(sys)
186183

187184

188-
@pytest.mark.usefixtures("mplcleanup")
189185
def test_nyquist_indent():
190186
# FBS Figure 10.10
191187
s = ct.tf('s')

0 commit comments

Comments
 (0)