@@ -98,9 +98,10 @@ def test_nyquist_basic():
9898 count , contour_indented = ct .nyquist_plot (
9999 sys , np .linspace (1e-4 , 1e2 , 100 ), return_contour = True )
100100 assert not all (contour_indented .real == 0 )
101- count , contour = ct .nyquist_plot (
102- sys , np .linspace (1e-4 , 1e2 , 100 ), return_contour = True ,
103- indent_direction = 'none' )
101+ with pytest .warns (UserWarning , match = "encirclements does not match" ):
102+ count , contour = ct .nyquist_plot (
103+ sys , np .linspace (1e-4 , 1e2 , 100 ), return_contour = True ,
104+ indent_direction = 'none' )
104105 np .testing .assert_almost_equal (contour , 1j * np .linspace (1e-4 , 1e2 , 100 ))
105106
106107 # Nyquist plot with poles at the origin, omega unspecified
@@ -166,10 +167,11 @@ def test_nyquist_fbs_examples():
166167
167168 plt .figure ()
168169 plt .title ("Figure 10.10: L(s) = 3 (s+6)^2 / (s (s+1)^2) [zoom]" )
169- count = ct .nyquist_plot (sys , omega_limits = [1.5 , 1e3 ])
170- # Frequency limits for zoom give incorrect encirclement count
171- # assert _Z(sys) == count + _P(sys)
172- assert count == - 1
170+ with pytest .warns (UserWarning , match = "encirclements does not match" ):
171+ count = ct .nyquist_plot (sys , omega_limits = [1.5 , 1e3 ])
172+ # Frequency limits for zoom give incorrect encirclement count
173+ # assert _Z(sys) == count + _P(sys)
174+ assert count == - 1
173175
174176
175177@pytest .mark .parametrize ("arrows" , [
@@ -276,8 +278,9 @@ def test_nyquist_indent_im():
276278
277279 # Imaginary poles with no indentation
278280 plt .figure ();
279- count = ct .nyquist_plot (
280- sys , np .linspace (0 , 1e3 , 1000 ), indent_direction = 'none' )
281+ with pytest .warns (UserWarning , match = "encirclements does not match" ):
282+ count = ct .nyquist_plot (
283+ sys , np .linspace (0 , 1e3 , 1000 ), indent_direction = 'none' )
281284 plt .title (
282285 "Imaginary poles; indent_direction='none'; encirclements = %d" % count )
283286 assert _Z (sys ) == count + _P (sys )
0 commit comments