Skip to content

Commit 330e517

Browse files
committed
unit tests now test for deprecation of sys.freqresp
1 parent 3cf80af commit 330e517

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

control/tests/statesp_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ def test_freqresp_deprecated(self):
223223

224224
# Make sure that we get a pending deprecation warning
225225
sys.freqresp(1.)
226-
assert issubclass(w[-1].category, PendingDeprecationWarning)
226+
assert issubclass(w[-1].category, DeprecationWarning)
227227

228228
@unittest.skipIf(not slycot_check(), "slycot not installed")
229229
def test_freq_resp(self):

control/tests/xferfcn_test.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,19 @@ def test_call_mimo(self):
432432
# Test call version as well
433433
np.testing.assert_array_almost_equal(sys(2.j), resp)
434434

435+
def test_freqresp_deprecated(self):
436+
sys = TransferFunction([1., 3., 5], [1., 6., 2., -1.])
437+
# Deprecated version of the call (should generate warning)
438+
import warnings
439+
with warnings.catch_warnings(record=True) as w:
440+
# Set up warnings filter to only show warnings in control module
441+
warnings.filterwarnings("ignore")
442+
warnings.filterwarnings("always", module="control")
443+
444+
# Make sure that we get a pending deprecation warning
445+
sys.freqresp(1.)
446+
assert issubclass(w[-1].category, DeprecationWarning)
447+
435448
def test_frequency_response_siso(self):
436449
"""Evaluate the magnitude and phase of a SISO system at
437450
multiple frequencies."""

0 commit comments

Comments
 (0)