From 91f90d27ee58121ff9ebde8536fab6548087d00e Mon Sep 17 00:00:00 2001 From: holger krekel Date: Fri, 28 Aug 2009 13:00:36 +0200 Subject: [PATCH] simplify broken-repr test for python2.4 --HG-- branch : trunk --- py/test/testing/test_session.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/py/test/testing/test_session.py b/py/test/testing/test_session.py index 1da3b487d..14df412fd 100644 --- a/py/test/testing/test_session.py +++ b/py/test/testing/test_session.py @@ -93,10 +93,6 @@ class SessionTests: foo=0 def __repr__(self): raise Exception("Ha Ha fooled you, I'm a broken repr().") - class BrokenRepr2: - foo=0 - def __repr__(self): - raise "Ha Ha fooled you, I'm a broken repr()." class TestBrokenClass: def test_explicit_bad_repr(self): @@ -107,18 +103,12 @@ class SessionTests: t = BrokenRepr1() assert t.foo == 1 - def test_implicit_bad_repr2(self): - t = BrokenRepr2() - assert t.foo == 1 """) reprec = testdir.inline_run(p) passed, skipped, failed = reprec.listoutcomes() - assert len(failed) == 2 + assert len(failed) == 1 out = failed[0].longrepr.reprcrash.message assert out.find("""[Exception("Ha Ha fooled you, I'm a broken repr().") raised in repr()]""") != -1 #' - out = failed[1].longrepr.reprcrash.message - assert (out.find("[unknown exception raised in repr()]") != -1 or - out.find("TypeError") != -1) def test_skip_by_conftest_directory(self, testdir): testdir.makepyfile(conftest="""