summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-04-23 17:50:05 (GMT)
committerBenjamin Peterson <benjamin@python.org>2012-04-23 17:50:05 (GMT)
commit9bc36530831b3b59b68b0579aeb01cd27ea36c20 (patch)
tree44bbc2caba84e803133e097cfb517d93e6bba2a7 /Lib/test
parentdb780d0d13976b099b22bc5145a53ec3ff6c63ba (diff)
parent8c52ab597f6f3fc17bdcd157ed53c88e016ae2bb (diff)
downloadcpython-9bc36530831b3b59b68b0579aeb01cd27ea36c20.zip
cpython-9bc36530831b3b59b68b0579aeb01cd27ea36c20.tar.gz
cpython-9bc36530831b3b59b68b0579aeb01cd27ea36c20.tar.bz2
merge heads
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_pydoc.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py
index a9f75b9..8e2001b 100644
--- a/Lib/test/test_pydoc.py
+++ b/Lib/test/test_pydoc.py
@@ -286,6 +286,17 @@ class PydocDocTest(unittest.TestCase):
result, doc_loc = get_pydoc_text(xml.etree)
self.assertEqual(doc_loc, "", "MODULE DOCS incorrectly includes a link")
+ def test_non_str_name(self):
+ # issue14638
+ # Treat illegal (non-str) name like no name
+ class A:
+ __name__ = 42
+ class B:
+ pass
+ adoc = pydoc.render_doc(A())
+ bdoc = pydoc.render_doc(B())
+ self.assertEqual(adoc.replace("A", "B"), bdoc)
+
def test_not_here(self):
missing_module = "test.i_am_not_here"
result = str(run_pydoc(missing_module), 'ascii')