From 03cb37b1eb2d54f8ebbb9959ae6e754d54edb2bb Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Mon, 19 Dec 2011 11:56:22 -0500 Subject: [PATCH] use an exception more consistent across python versions --- testing/test_assertinterpret.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/testing/test_assertinterpret.py b/testing/test_assertinterpret.py index 316cf49d4..fc456c636 100644 --- a/testing/test_assertinterpret.py +++ b/testing/test_assertinterpret.py @@ -28,17 +28,14 @@ def test_assert_with_explicit_message(): assert e.msg == 'hello' def test_assert_within_finally(): - class A: - def f(): - pass - excinfo = py.test.raises(TypeError, """ + excinfo = py.test.raises(ZeroDivisionError, """ try: - A().f() + 1/0 finally: i = 42 """) s = excinfo.exconly() - assert s.find("takes no argument") != -1 + assert py.std.re.search("division.+by zero", s) is not None #def g(): # A.f()