diff options
author | Raymond Hettinger <python@rcn.com> | 2007-10-12 17:53:11 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2007-10-12 17:53:11 (GMT) |
commit | 3a0de08d5468c18ba09443cbe2f3b661ddd775e0 (patch) | |
tree | 064ab0799202d6804a5286098df3e712c2862d0a /Lib | |
parent | d476a400b4d99d358b817bfe7229d0085f50e597 (diff) | |
download | cpython-3a0de08d5468c18ba09443cbe2f3b661ddd775e0.zip cpython-3a0de08d5468c18ba09443cbe2f3b661ddd775e0.tar.gz cpython-3a0de08d5468c18ba09443cbe2f3b661ddd775e0.tar.bz2 |
Fix test of count.__repr__() to ignore the 'L' if the count is a long
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_itertools.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py index 3a370d9..1a3064c 100644 --- a/Lib/test/test_itertools.py +++ b/Lib/test/test_itertools.py @@ -67,7 +67,10 @@ class TestBasicOps(unittest.TestCase): c.next() self.assertEqual(c.next(), -8) for i in (-sys.maxint-5, -sys.maxint+5 ,-10, -1, 0, 10, sys.maxint-5, sys.maxint+5): - self.assertEqual(repr(count(i)), 'count(%r)' % i) + # Test repr (ignoring the L in longs) + r1 = repr(count(i)).replace('L', '') + r2 = 'count(%r)'.__mod__(i).replace('L', '') + self.assertEqual(r1, r2) def test_cycle(self): self.assertEqual(take(10, cycle('abc')), list('abcabcabca')) |