mirror of https://github.com/python/cpython
Add a test for the final branch in repr.Repr.repr1(), which deals with
a default repr() that's longer than 20 characters.
This commit is contained in:
parent
785261684e
commit
cf856f9f28
|
@ -78,6 +78,11 @@ class ReprTests(unittest.TestCase):
|
|||
i3 = ClassWithFailingRepr()
|
||||
eq(r(i3), ("<ClassWithFailingRepr instance at %x>"%id(i3)))
|
||||
|
||||
s = r(ClassWithFailingRepr)
|
||||
self.failUnless(s.startswith("<class "))
|
||||
self.failUnless(s.endswith(">"))
|
||||
self.failUnless(s.find("...") == 8)
|
||||
|
||||
def test_file(self):
|
||||
fp = open(unittest.__file__)
|
||||
self.failUnless(repr(fp).startswith(
|
||||
|
|
Loading…
Reference in New Issue