projects
/
python
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7852616
)
Add a test for the final branch in repr.Repr.repr1(), which deals with
author
Guido van Rossum
<guido@python.org>
Wed, 5 Sep 2001 02:26:26 +0000
(
02:26
+0000)
committer
Guido van Rossum
<guido@python.org>
Wed, 5 Sep 2001 02:26:26 +0000
(
02:26
+0000)
a default repr() that's longer than 20 characters.
Lib/test/test_repr.py
patch
|
blob
|
history
diff --git
a/Lib/test/test_repr.py
b/Lib/test/test_repr.py
index 1281b1f27661bce15288957c54ae133d749aec5c..c23fe77135eac40192d8a5e1b3d075d778a309dd 100644
(file)
--- 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), ("<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(