@@ -728,6 +728,9 @@ def test_squeeze(self, fcn, nstate, nout, ninp, squeeze, shape):
728
728
"requires slycot." )
729
729
else :
730
730
sys = fcn (ct .rss (nstate , nout , ninp , strictly_proper = True ))
731
+
732
+ # Keep track of expect users warnings
733
+ warntype = UserWarning if sys .inputs > 1 else None
731
734
732
735
# Compute the length of the frequency array
733
736
tvec = np .linspace (0 , 1 , 8 )
@@ -736,13 +739,15 @@ def test_squeeze(self, fcn, nstate, nout, ninp, squeeze, shape):
736
739
np .reshape (np .sin (tvec ), (1 , 8 )))
737
740
738
741
# Pass squeeze argument and make sure the shape is correct
739
- _ , yvec = ct .impulse_response (sys , tvec , squeeze = squeeze )
742
+ with pytest .warns (warntype , match = "Converting MIMO system" ):
743
+ _ , yvec = ct .impulse_response (sys , tvec , squeeze = squeeze )
740
744
assert yvec .shape == shape
741
745
742
746
_ , yvec = ct .initial_response (sys , tvec , 1 , squeeze = squeeze )
743
747
assert yvec .shape == shape
744
748
745
- _ , yvec = ct .step_response (sys , tvec , squeeze = squeeze )
749
+ with pytest .warns (warntype , match = "Converting MIMO system" ):
750
+ _ , yvec = ct .step_response (sys , tvec , squeeze = squeeze )
746
751
assert yvec .shape == shape
747
752
748
753
_ , yvec , xvec = ct .forced_response (
@@ -772,13 +777,15 @@ def test_squeeze(self, fcn, nstate, nout, ninp, squeeze, shape):
772
777
ct .config .set_defaults ('control' , squeeze = False )
773
778
774
779
# Pass squeeze argument and make sure the shape is correct
775
- _ , yvec = ct .impulse_response (sys , tvec )
780
+ with pytest .warns (warntype , match = "Converting MIMO system" ):
781
+ _ , yvec = ct .impulse_response (sys , tvec )
776
782
assert yvec .shape == (sys .outputs , 8 )
777
783
778
784
_ , yvec = ct .initial_response (sys , tvec , 1 )
779
785
assert yvec .shape == (sys .outputs , 8 )
780
786
781
- _ , yvec = ct .step_response (sys , tvec )
787
+ with pytest .warns (warntype , match = "Converting MIMO system" ):
788
+ _ , yvec = ct .step_response (sys , tvec )
782
789
assert yvec .shape == (sys .outputs , 8 )
783
790
784
791
_ , yvec , xvec = ct .forced_response (
0 commit comments