Skip to content

Commit 70bf207

Browse files
committed
update statesp_test.py unit test to fix numpy warnings
1 parent a007fcc commit 70bf207

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

control/tests/statesp_test.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,11 @@ def testEvalFr(self):
148148
# Deprecated version of the call (should generate warning)
149149
import warnings
150150
with warnings.catch_warnings(record=True) as w:
151-
warnings.simplefilter("always")
151+
# Set up warnings filter to only show warnings in control module
152+
warnings.filterwarnings("ignore")
153+
warnings.filterwarnings("always", module="control")
154+
155+
# Make sure that we get a pending deprecation warning
152156
sys.evalfr(1.)
153157
assert len(w) == 1
154158
assert issubclass(w[-1].category, PendingDeprecationWarning)

0 commit comments

Comments
 (0)