From 0d5048cb21e431c1a8221e15563837090946be81 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Mon, 12 Sep 2016 00:18:31 -0700 Subject: Issue #17941: Add a *module* parameter to collections.namedtuple() --- Lib/test/test_collections.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Lib/test/test_collections.py') 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) -- cgit v1.2.1