diff options
Diffstat (limited to 'Lib/test/test_collections.py')
-rw-r--r-- | Lib/test/test_collections.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py index 939c3cebff..c260bc78ff 100644 --- a/Lib/test/test_collections.py +++ b/Lib/test/test_collections.py @@ -40,6 +40,11 @@ class TestNamedTuple(unittest.TestCase): p = Point(x=11, y=22) self.assertEqual(repr(p), 'Point(x=11, y=22)') + # verify that fieldspec can be a non-string sequence + Point = NamedTuple('Point', ('x', 'y')) + p = Point(x=11, y=22) + self.assertEqual(repr(p), 'Point(x=11, y=22)') + def test_tupleness(self): Point = NamedTuple('Point', 'x y') p = Point(11, 22) |