diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2013-07-17 14:08:20 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2013-08-12 22:36:16 -0600 |
commit | a36ef7a8a8dd74830e0af3c8135cf4077891a96d (patch) | |
tree | 024d545924a82babf1783a90f05701e96fbe9552 | |
parent | f8244a6888863cb40fc93b272b6055141df4b322 (diff) | |
download | numpy-a36ef7a8a8dd74830e0af3c8135cf4077891a96d.tar.gz |
BUG: Regression test needs to ignore ComplexWarning.
This was raising a warning during tests.
-rw-r--r-- | numpy/core/tests/test_regression.py | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/numpy/core/tests/test_regression.py b/numpy/core/tests/test_regression.py index 740957215..86b0e48a2 100644 --- a/numpy/core/tests/test_regression.py +++ b/numpy/core/tests/test_regression.py @@ -1449,14 +1449,17 @@ class TestRegression(TestCase): and not issubclass(x, np.timedelta64))] a = np.array([], dtypes[0]) failures = [] - for x in dtypes: - b = a.astype(x) - for y in dtypes: - c = a.astype(y) - try: - np.dot(b, c) - except TypeError as e: - failures.append((x, y)) + # ignore complex warnings + with warnings.catch_warnings(): + warnings.simplefilter('ignore', np.ComplexWarning) + for x in dtypes: + b = a.astype(x) + for y in dtypes: + c = a.astype(y) + try: + np.dot(b, c) + except TypeError as e: + failures.append((x, y)) if failures: raise AssertionError("Failures: %r" % failures) |