From: Guido van Rossum Date: Wed, 5 Sep 2001 02:26:26 +0000 (+0000) Subject: Add a test for the final branch in repr.Repr.repr1(), which deals with X-Git-Tag: v2.2a3~98 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cf856f9f28e4a2806fa835fb4e0e54582c0a2edd;p=python Add a test for the final branch in repr.Repr.repr1(), which deals with a default repr() that's longer than 20 characters. --- diff --git a/Lib/test/test_repr.py b/Lib/test/test_repr.py index 1281b1f276..c23fe77135 100644 --- a/Lib/test/test_repr.py +++ b/Lib/test/test_repr.py @@ -78,6 +78,11 @@ class ReprTests(unittest.TestCase): i3 = ClassWithFailingRepr() eq(r(i3), (""%id(i3))) + s = r(ClassWithFailingRepr) + self.failUnless(s.startswith("")) + self.failUnless(s.find("...") == 8) + def test_file(self): fp = open(unittest.__file__) self.failUnless(repr(fp).startswith(