10
10
11
11
import pytest
12
12
import numpy as np
13
- import scipy as sp
14
13
import matplotlib .pyplot as plt
15
14
import control as ct
16
15
16
+ pytestmark = pytest .mark .usefixtures ("mplcleanup" )
17
+
17
18
18
19
# Utility function for counting unstable poles of open loop (P in FBS)
19
20
def _P (sys , indent = 'right' ):
@@ -34,7 +35,6 @@ def _Z(sys):
34
35
35
36
36
37
# Basic tests
37
- @pytest .mark .usefixtures ("mplcleanup" )
38
38
def test_nyquist_basic ():
39
39
# Simple Nyquist plot
40
40
sys = ct .rss (5 , 1 , 1 )
@@ -109,7 +109,6 @@ def test_nyquist_basic():
109
109
110
110
111
111
# Some FBS examples, for comparison
112
- @pytest .mark .usefixtures ("mplcleanup" )
113
112
def test_nyquist_fbs_examples ():
114
113
s = ct .tf ('s' )
115
114
@@ -151,7 +150,6 @@ def test_nyquist_fbs_examples():
151
150
1 , 2 , 3 , 4 , # specified number of arrows
152
151
[0.1 , 0.5 , 0.9 ], # specify arc lengths
153
152
])
154
- @pytest .mark .usefixtures ("mplcleanup" )
155
153
def test_nyquist_arrows (arrows ):
156
154
sys = ct .tf ([1.4 ], [1 , 2 , 1 ]) * ct .tf (* ct .pade (1 , 4 ))
157
155
plt .figure ();
@@ -160,7 +158,6 @@ def test_nyquist_arrows(arrows):
160
158
assert _Z (sys ) == count + _P (sys )
161
159
162
160
163
- @pytest .mark .usefixtures ("mplcleanup" )
164
161
def test_nyquist_encirclements ():
165
162
# Example 14.14: effect of friction in a cart-pendulum system
166
163
s = ct .tf ('s' )
@@ -185,7 +182,6 @@ def test_nyquist_encirclements():
185
182
assert _Z (sys ) == count + _P (sys )
186
183
187
184
188
- @pytest .mark .usefixtures ("mplcleanup" )
189
185
def test_nyquist_indent ():
190
186
# FBS Figure 10.10
191
187
s = ct .tf ('s' )
0 commit comments