diff options
author | Georg Brandl <georg@python.org> | 2008-05-18 10:39:26 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-05-18 10:39:26 (GMT) |
commit | 0bb0299ad8c538eb6d24644b8305c45c110d6c4f (patch) | |
tree | 50a67aa05f5d71c63acc16d6488801c542116ce5 /Lib/test | |
parent | f899dfa1d179a126b5e23a9c61199293b89f6d70 (diff) | |
download | cpython-0bb0299ad8c538eb6d24644b8305c45c110d6c4f.zip cpython-0bb0299ad8c538eb6d24644b8305c45c110d6c4f.tar.gz cpython-0bb0299ad8c538eb6d24644b8305c45c110d6c4f.tar.bz2 |
Take namedtuple item names only from ascii_letters (this blew up on OSX),
and make sure there are no duplicate names.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_collections.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py index 15f0bf7..a770155 100644 --- a/Lib/test/test_collections.py +++ b/Lib/test/test_collections.py @@ -110,7 +110,9 @@ class TestNamedTuple(unittest.TestCase): n = 10000 import string, random - names = [''.join([random.choice(string.letters) for j in range(10)]) for i in range(n)] + names = list(set(''.join([random.choice(string.ascii_letters) + for j in range(10)]) for i in range(n))) + n = len(names) Big = namedtuple('Big', names) b = Big(*range(n)) self.assertEqual(b, tuple(range(n))) |