summaryrefslogtreecommitdiff
path: root/Lib/test/test_pydoc.py
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-06-12 04:31:25 +0000
committerMartin Panter <vadmium+py@gmail.com>2016-06-12 04:31:25 +0000
commit826aa8295c78524fd810e0d7f87c8f13dc15b410 (patch)
tree455afdf575f24f936b7d6016612c5afe96242f4c /Lib/test/test_pydoc.py
parenta9325421d37a70038bf0be6138ccac8a14cffec5 (diff)
parent3a9cf1568b8063cd4c1c9168ee4aa7e15ffc131d (diff)
downloadcpython-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.py16
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()