summaryrefslogtreecommitdiff
path: root/Lib/test
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2012-04-23 21:26:58 -0700
committerRaymond Hettinger <python@rcn.com>2012-04-23 21:26:58 -0700
commite65753e09e9b8a383b68b71f7e39d597b0c61b68 (patch)
tree7c3536e4b7c5afbaac0d7235721fa4f9c7a8d0ca /Lib/test
parentce0e0c7671a57f26b1765ef35197f6bffc0459ae (diff)
parent393b7b59a48b1cef11d76e9ca71cf8fa5972eda5 (diff)
downloadcpython-git-e65753e09e9b8a383b68b71f7e39d597b0c61b68.tar.gz
merge
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_pydoc.py11
-rw-r--r--Lib/test/test_thread.py2
2 files changed, 12 insertions, 1 deletions
diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py
index 59cbffe6d2..d95e7069ce 100644
--- a/Lib/test/test_pydoc.py
+++ b/Lib/test/test_pydoc.py
@@ -249,6 +249,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 = run_pydoc(missing_module)
diff --git a/Lib/test/test_thread.py b/Lib/test/test_thread.py
index ae9a7d9527..413889ad22 100644
--- a/Lib/test/test_thread.py
+++ b/Lib/test/test_thread.py
@@ -150,7 +150,7 @@ class ThreadRunningTests(BasicThreadTest):
thread.start_new_thread(task, ())
started.acquire()
while thread._count() > c:
- pass
+ time.sleep(0.01)
self.assertIn("Traceback", stderr.getvalue())