summaryrefslogtreecommitdiff
path: root/Lib/test/test_collections.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2016-09-12 00:18:31 -0700
committerRaymond Hettinger <python@rcn.com>2016-09-12 00:18:31 -0700
commit0d5048cb21e431c1a8221e15563837090946be81 (patch)
treec9e5960273276eb9377a54b8438dac48508161db /Lib/test/test_collections.py
parent11fa3ffcb11caf628435670b213f9bc2e3ba4f67 (diff)
downloadcpython-git-0d5048cb21e431c1a8221e15563837090946be81.tar.gz
Issue #17941: Add a *module* parameter to collections.namedtuple()
Diffstat (limited to 'Lib/test/test_collections.py')
-rw-r--r--Lib/test/test_collections.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py
index f1fb011266..52ff256eb9 100644
--- a/Lib/test/test_collections.py
+++ b/Lib/test/test_collections.py
@@ -242,6 +242,10 @@ class TestNamedTuple(unittest.TestCase):
]:
self.assertEqual(namedtuple('NT', spec, rename=True)._fields, renamed)
+ def test_module_parameter(self):
+ NT = namedtuple('NT', ['x', 'y'], module=collections)
+ self.assertEqual(NT.__module__, collections)
+
def test_instance(self):
Point = namedtuple('Point', 'x y')
p = Point(11, 22)