1010
1111import pytest
1212import numpy as np
13- import scipy as sp
1413import matplotlib .pyplot as plt
1514import 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)
1920def _P (sys , indent = 'right' ):
@@ -34,7 +35,6 @@ def _Z(sys):
3435
3536
3637# Basic tests
37- @pytest .mark .usefixtures ("mplcleanup" )
3838def 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" )
113112def 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" )
155153def 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" )
164161def 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" )
189185def test_nyquist_indent ():
190186 # FBS Figure 10.10
191187 s = ct .tf ('s' )
0 commit comments