@@ -728,6 +728,9 @@ def test_squeeze(self, fcn, nstate, nout, ninp, squeeze, shape):
728728 "requires slycot." )
729729 else :
730730 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
731734
732735 # Compute the length of the frequency array
733736 tvec = np .linspace (0 , 1 , 8 )
@@ -736,13 +739,15 @@ def test_squeeze(self, fcn, nstate, nout, ninp, squeeze, shape):
736739 np .reshape (np .sin (tvec ), (1 , 8 )))
737740
738741 # 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 )
740744 assert yvec .shape == shape
741745
742746 _ , yvec = ct .initial_response (sys , tvec , 1 , squeeze = squeeze )
743747 assert yvec .shape == shape
744748
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 )
746751 assert yvec .shape == shape
747752
748753 _ , yvec , xvec = ct .forced_response (
@@ -772,13 +777,15 @@ def test_squeeze(self, fcn, nstate, nout, ninp, squeeze, shape):
772777 ct .config .set_defaults ('control' , squeeze = False )
773778
774779 # 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 )
776782 assert yvec .shape == (sys .outputs , 8 )
777783
778784 _ , yvec = ct .initial_response (sys , tvec , 1 )
779785 assert yvec .shape == (sys .outputs , 8 )
780786
781- _ , yvec = ct .step_response (sys , tvec )
787+ with pytest .warns (warntype , match = "Converting MIMO system" ):
788+ _ , yvec = ct .step_response (sys , tvec )
782789 assert yvec .shape == (sys .outputs , 8 )
783790
784791 _ , yvec , xvec = ct .forced_response (
0 commit comments