diff options
author | Patrick Peglar <patrick.peglar@metoffice.gov.uk> | 2014-09-01 17:22:12 +0100 |
---|---|---|
committer | pp-mo <patrick.peglar@metoffice.gov.uk> | 2014-09-02 00:41:37 +0100 |
commit | ea32c9057f47d634bde5370f373a88aa6bfa7478 (patch) | |
tree | 8ce39846b45efbb5217839b3caaafed214be7d7e /numpy/testing | |
parent | 4097ec3ec10c41d399518867f4bebb0a53ee8a5c (diff) | |
download | numpy-ea32c9057f47d634bde5370f373a88aa6bfa7478.tar.gz |
Use more portable test methods.
Diffstat (limited to 'numpy/testing')
-rw-r--r-- | numpy/testing/tests/test_utils.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/numpy/testing/tests/test_utils.py b/numpy/testing/tests/test_utils.py index c1d0e83da..5189f7e63 100644 --- a/numpy/testing/tests/test_utils.py +++ b/numpy/testing/tests/test_utils.py @@ -452,8 +452,12 @@ class TestAssertAllclose(unittest.TestCase): def test_report_fail_percentage(self): a = np.array([1, 1, 1, 1]) b = np.array([1, 1, 1, 2]) - with self.assertRaisesRegexp(AssertionError, "25.0%"): + try: assert_allclose(a, b) + msg = '' + except AssertionError as exc: + msg = exc.args[0] + self.assertTrue("mismatch 25.0%" in msg) class TestArrayAlmostEqualNulp(unittest.TestCase): @dec.knownfailureif(True, "Github issue #347") |