Skip to content

Commit 55f4bb6

Browse files
committed
Fix warning check for python 2.7
Python 2.7 represses repeated warnings in a way that causes the unit test to fail => make sure that warnings are always generated
1 parent 057c5ca commit 55f4bb6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

control/tests/freqresp_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ def test_discrete(self):
139139

140140
# Check for warning if frequency is out of range
141141
import warnings
142+
warnings.simplefilter('always', UserWarning) # don't supress
142143
with warnings.catch_warnings(record=True) as w:
143144
omega_bad = np.linspace(10e-4,1.1,10) * np.pi/sys.dt
144145
ret = sys.freqresp(omega_bad)

0 commit comments

Comments
 (0)