diff options
author | Raymond Hettinger <python@rcn.com> | 2011-03-23 19:52:23 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2011-03-23 19:52:23 (GMT) |
commit | 2ebea41d315bb42a6d6983137bf5fdb01d3f1a95 (patch) | |
tree | cdfff191e34b120df6271ab3a77a692548d832d8 /Lib/test/test_collections.py | |
parent | 843a751369856f97f936c94a562b461254941b35 (diff) | |
download | cpython-2ebea41d315bb42a6d6983137bf5fdb01d3f1a95.zip cpython-2ebea41d315bb42a6d6983137bf5fdb01d3f1a95.tar.gz cpython-2ebea41d315bb42a6d6983137bf5fdb01d3f1a95.tar.bz2 |
Expose the namedtuple source with a _source attribute.
Diffstat (limited to 'Lib/test/test_collections.py')
-rw-r--r-- | Lib/test/test_collections.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py index d71fb01..cdc7db9 100644 --- a/Lib/test/test_collections.py +++ b/Lib/test/test_collections.py @@ -127,6 +127,7 @@ class TestNamedTuple(unittest.TestCase): self.assertEqual(Point.__module__, __name__) self.assertEqual(Point.__getitem__, tuple.__getitem__) self.assertEqual(Point._fields, ('x', 'y')) + self.assertIn('class Point(tuple)', Point._source) self.assertRaises(ValueError, namedtuple, 'abc%', 'efg ghi') # type has non-alpha char self.assertRaises(ValueError, namedtuple, 'class', 'efg ghi') # type has keyword |