[Scipy-svn] r6875 - trunk/scipy/signal/tests
scipy-svn@scip...
scipy-svn@scip...
Sat Nov 13 14:20:24 CST 2010
Author: warren.weckesser
Date: 2010-11-13 14:20:24 -0600 (Sat, 13 Nov 2010)
New Revision: 6875
Modified:
trunk/scipy/signal/tests/test_filter_design.py
Log:
TST: signal: simplify a test--in the old version, the warning was actually triggered in the call to bessel(), so the line containing tf2zpk in the test was never reached.
Modified: trunk/scipy/signal/tests/test_filter_design.py
===================================================================
--- trunk/scipy/signal/tests/test_filter_design.py 2010-11-13 20:04:36 UTC (rev 6874)
+++ trunk/scipy/signal/tests/test_filter_design.py 2010-11-13 20:20:24 UTC (rev 6875)
@@ -1,12 +1,13 @@
import warnings
import numpy as np
-from numpy.testing import TestCase, assert_array_almost_equal
+from numpy.testing import TestCase, assert_array_almost_equal, assert_raises
from scipy.signal import tf2zpk, bessel, BadCoefficients
class TestTf2zpk(TestCase):
+
def test_simple(self):
z_r = np.array([0.5, -0.5])
p_r = np.array([1.j / np.sqrt(2), -1.j / np.sqrt(2)])
@@ -28,12 +29,6 @@
filter coefficients."""
warnings.simplefilter("error", BadCoefficients)
try:
- try:
- b, a = bessel(20, 0.1)
- z, p, k = tf2zpk(b, a)
- raise AssertionError("tf2zpk did not warn about bad "\
- "coefficients")
- except BadCoefficients:
- pass
+ assert_raises(BadCoefficients, tf2zpk, [1e-15], [1.0, 1.0])
finally:
warnings.simplefilter("always", BadCoefficients)
More information about the Scipy-svn
mailing list