mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
[680789] Debug with long array takes forever
Added array.array to the types repr.py knows about, after a suggestion from Jurjen N.E. Bos.
This commit is contained in:
parent
5c4ded2c3b
commit
6ee0480521
3 changed files with 33 additions and 0 deletions
|
@ -34,6 +34,8 @@ class ReprTests(unittest.TestCase):
|
|||
eq(r(s), expected)
|
||||
|
||||
def test_container(self):
|
||||
from array import array
|
||||
|
||||
eq = self.assertEquals
|
||||
# Tuples give up after 6 elements
|
||||
eq(r(()), "()")
|
||||
|
@ -56,6 +58,16 @@ class ReprTests(unittest.TestCase):
|
|||
d['arthur'] = 1
|
||||
eq(r(d), "{'alice': 1, 'arthur': 1, 'bob': 2, 'charles': 3, ...}")
|
||||
|
||||
# array.array after 5.
|
||||
eq(r(array('i')), "array('i', [])")
|
||||
eq(r(array('i', [1])), "array('i', [1])")
|
||||
eq(r(array('i', [1, 2])), "array('i', [1, 2])")
|
||||
eq(r(array('i', [1, 2, 3])), "array('i', [1, 2, 3])")
|
||||
eq(r(array('i', [1, 2, 3, 4])), "array('i', [1, 2, 3, 4])")
|
||||
eq(r(array('i', [1, 2, 3, 4, 5])), "array('i', [1, 2, 3, 4, 5])")
|
||||
eq(r(array('i', [1, 2, 3, 4, 5, 6])),
|
||||
"array('i', [1, 2, 3, 4, 5, ...])")
|
||||
|
||||
def test_numbers(self):
|
||||
eq = self.assertEquals
|
||||
eq(r(123), repr(123))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue