diff options
author | Martin Panter <vadmium+py@gmail.com> | 2016-06-12 04:31:25 +0000 |
---|---|---|
committer | Martin Panter <vadmium+py@gmail.com> | 2016-06-12 04:31:25 +0000 |
commit | 826aa8295c78524fd810e0d7f87c8f13dc15b410 (patch) | |
tree | 455afdf575f24f936b7d6016612c5afe96242f4c /Lib/test/test_pydoc.py | |
parent | a9325421d37a70038bf0be6138ccac8a14cffec5 (diff) | |
parent | 3a9cf1568b8063cd4c1c9168ee4aa7e15ffc131d (diff) | |
download | cpython-826aa8295c78524fd810e0d7f87c8f13dc15b410.tar.gz |
Issue #16484: Merge pydoc Windows fixes from 3.5
Diffstat (limited to 'Lib/test/test_pydoc.py')
-rw-r--r-- | Lib/test/test_pydoc.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index aee979b8e8..889ce592db 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -855,6 +855,22 @@ class TestDescriptions(unittest.TestCase): self.assertEqual(self._get_summary_line(t.wrap), "wrap(text) method of textwrap.TextWrapper instance") + def test_field_order_for_named_tuples(self): + Person = namedtuple('Person', ['nickname', 'firstname', 'agegroup']) + s = pydoc.render_doc(Person) + self.assertLess(s.index('nickname'), s.index('firstname')) + self.assertLess(s.index('firstname'), s.index('agegroup')) + + class NonIterableFields: + _fields = None + + class NonHashableFields: + _fields = [[]] + + # Make sure these doesn't fail + pydoc.render_doc(NonIterableFields) + pydoc.render_doc(NonHashableFields) + @requires_docstrings def test_bound_builtin_method(self): s = StringIO() |