diff options
author | Raymond Hettinger <python@rcn.com> | 2016-09-12 00:18:31 -0700 |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2016-09-12 00:18:31 -0700 |
commit | 0d5048cb21e431c1a8221e15563837090946be81 (patch) | |
tree | c9e5960273276eb9377a54b8438dac48508161db /Lib/test/test_collections.py | |
parent | 11fa3ffcb11caf628435670b213f9bc2e3ba4f67 (diff) | |
download | cpython-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.py | 4 |
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) |