summaryrefslogtreecommitdiff
path: root/Lib/test/test_pydoc.py
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2016-09-05 14:50:11 -0700
committerEric Snow <ericsnowcurrently@gmail.com>2016-09-05 14:50:11 -0700
commit823616bdc22856b5df918a443051ec6ec2e9073c (patch)
tree4c8bb3f2256071ef2508710cbde106adc49708fb /Lib/test/test_pydoc.py
parent8eccf5f8b9c00a5d881f9d0fab230d4a48d36d2c (diff)
downloadcpython-823616bdc22856b5df918a443051ec6ec2e9073c.tar.gz
Issue #24254: Preserve class attribute definition order.
Diffstat (limited to 'Lib/test/test_pydoc.py')
-rw-r--r--Lib/test/test_pydoc.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py
index 4998597e21..527234bc6e 100644
--- a/Lib/test/test_pydoc.py
+++ b/Lib/test/test_pydoc.py
@@ -427,6 +427,7 @@ class PydocDocTest(unittest.TestCase):
expected_html = expected_html_pattern % (
(mod_url, mod_file, doc_loc) +
expected_html_data_docstrings)
+ self.maxDiff = None
self.assertEqual(result, expected_html)
@unittest.skipIf(sys.flags.optimize >= 2,
@@ -473,13 +474,18 @@ class PydocDocTest(unittest.TestCase):
def test_non_str_name(self):
# issue14638
# Treat illegal (non-str) name like no name
+ # Definition order is set to None so it looks the same in both
+ # cases.
class A:
+ __definition_order__ = None
__name__ = 42
class B:
pass
adoc = pydoc.render_doc(A())
bdoc = pydoc.render_doc(B())
- self.assertEqual(adoc.replace("A", "B"), bdoc)
+ self.maxDiff = None
+ expected = adoc.replace("A", "B")
+ self.assertEqual(bdoc, expected)
def test_not_here(self):
missing_module = "test.i_am_not_here"