8000 Use more portable test methods. · numpy/numpy@ea32c90 · GitHub
[go: up one dir, main page]

Skip to content

Commit ea32c90

Browse files
committed
Use more portable test methods.
1 parent 4097ec3 commit ea32c90

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

numpy/testing/tests/test_utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,8 +452,12 @@ def test_min_int(self):
452452
def test_report_fail_percentage(self):
453453
a = np.array([1, 1, 1, 1])
454454
b = np.array([1, 1, 1, 2])
455-
with self.assertRaisesRegexp(AssertionError, "25.0%"):
455+
try:
456456
assert_allclose(a, b)
457+
msg = ''
458+
except AssertionError as exc:
459+
msg = exc.args[0]
460+
self.assertTrue("mismatch 25.0%" in msg)
457461

458462
class TestArrayAlmostEqualNulp(unittest.TestCase):
459463
@dec.knownfailureif(True, "Github issue #347")

0 commit comments

Comments
 (0)
0