From ea32c9057f47d634bde5370f373a88aa6bfa7478 Mon Sep 17 00:00:00 2001 From: Patrick Peglar Date: Mon, 1 Sep 2014 17:22:12 +0100 Subject: Use more portable test methods. --- numpy/testing/tests/test_utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'numpy/testing/tests') 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") -- cgit v1.2.1