summaryrefslogtreecommitdiff
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_collections.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py
index 94015b42d3..ab36ad87b7 100644
--- a/Lib/test/test_collections.py
+++ b/Lib/test/test_collections.py
@@ -58,6 +58,12 @@ class TestNamedTuple(unittest.TestCase):
self.assertRaises(AttributeError, eval, 'p.z', locals())
+ def test_odd_sizes(self):
+ Zero = NamedTuple('Zero', '')
+ self.assertEqual(Zero(), ())
+ Dot = NamedTuple('Dot', 'd')
+ self.assertEqual(Dot(1), (1,))
+
def test_main(verbose=None):
import collections as CollectionsModule
test_classes = [TestNamedTuple]