diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2007-06-11 07:29:43 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2007-06-11 07:29:43 (GMT) |
commit | c161cb995530521711e47425170524921fc1b559 (patch) | |
tree | 4a79895865935ffcb3feb0d474c2a480411e25be /Lib/test | |
parent | ade2c216e17d519bca6a9401c938e1b3ec374746 (diff) | |
download | cpython-c161cb995530521711e47425170524921fc1b559.zip cpython-c161cb995530521711e47425170524921fc1b559.tar.gz cpython-c161cb995530521711e47425170524921fc1b559.tar.bz2 |
Bug #1734723: Fix repr.Repr() so it doesn't ignore the maxtuple attribute.
Will backport
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_repr.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_repr.py b/Lib/test/test_repr.py index 5fcf815..a07ed71 100644 --- a/Lib/test/test_repr.py +++ b/Lib/test/test_repr.py @@ -10,6 +10,7 @@ import unittest from test.test_support import run_unittest from repr import repr as r # Don't shadow builtin repr +from repr import Repr def nestedTuple(nesting): @@ -34,6 +35,18 @@ class ReprTests(unittest.TestCase): expected = repr(s)[:13] + "..." + repr(s)[-14:] eq(r(s), expected) + def test_tuple(self): + eq = self.assertEquals + eq(r((1,)), "(1,)") + + t3 = (1, 2, 3) + eq(r(t3), "(1, 2, 3)") + + r2 = Repr() + r2.maxtuple = 2 + expected = repr(t3)[:-2] + "...)" + eq(r2.repr(t3), expected) + def test_container(self): from array import array from collections import deque |