summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_collections.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2008-09-25 23:31:52 (GMT)
committerRaymond Hettinger <python@rcn.com>2008-09-25 23:31:52 (GMT)
commit6ee7bc04f7d095bd7a2860a4fb9da331fa908ecd (patch)
tree4c86dc3c9881da87206f960f30262c258a779f70 /Lib/test/test_collections.py
parent17617a07d1f2d2ffb6b0f77be8926f54cd0f4ae8 (diff)
downloadcpython-6ee7bc04f7d095bd7a2860a4fb9da331fa908ecd.zip
cpython-6ee7bc04f7d095bd7a2860a4fb9da331fa908ecd.tar.gz
cpython-6ee7bc04f7d095bd7a2860a4fb9da331fa908ecd.tar.bz2
Fix namedtuple bug reported by Glenn Linderman. Template did not form correctly if the field names were input in Unicode.
Diffstat (limited to 'Lib/test/test_collections.py')
-rw-r--r--Lib/test/test_collections.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py
index d689add..7dffd73 100644
--- a/Lib/test/test_collections.py
+++ b/Lib/test/test_collections.py
@@ -34,6 +34,11 @@ class TestNamedTuple(unittest.TestCase):
namedtuple('Point0', 'x1 y2') # Verify that numbers are allowed in names
namedtuple('_', 'a b c') # Test leading underscores in a typename
+ nt = namedtuple('nt', u'the quick brown fox') # check unicode input
+ self.assert_("u'" not in repr(nt._fields))
+ nt = namedtuple('nt', (u'the', u'quick')) # check unicode input
+ self.assert_("u'" not in repr(nt._fields))
+
self.assertRaises(TypeError, Point._make, [11]) # catch too few args
self.assertRaises(TypeError, Point._make, [11, 22, 33]) # catch too many args