summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-04-24 21:00:04 (GMT)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-04-24 21:00:04 (GMT)
commit768db92b438038586c1580b711c528363a97d3f4 (patch)
tree5e026f60d9c50d4936ebef4345201c559ba887ad /Lib
parent8c03b4de9db8dfaccc93916af61baf6ff4f1c9b2 (diff)
downloadcpython-768db92b438038586c1580b711c528363a97d3f4.zip
cpython-768db92b438038586c1580b711c528363a97d3f4.tar.gz
cpython-768db92b438038586c1580b711c528363a97d3f4.tar.bz2
Correct recently merged tests:
- two bugs in pydoc.py - remove test about classic classes
Diffstat (limited to 'Lib')
-rwxr-xr-xLib/pydoc.py7
-rw-r--r--Lib/test/test_pydoc.py8
2 files changed, 4 insertions, 11 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index fbad574..31122e1 100755
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-# -*- coding: Latin-1 -*-
+# -*- coding: latin-1 -*-
"""Generate Python documentation in HTML or text for interactive use.
In the Python interpreter, do "from pydoc import help" to provide online
@@ -1074,7 +1074,7 @@ class TextDoc(Doc):
if submodules:
submodules.sort()
result = result + self.section(
- 'SUBMODULES', join(submodules, '\n'))
+ 'SUBMODULES', '\n'.join(submodules))
if classes:
classlist = [value for key, value in classes]
@@ -1484,7 +1484,8 @@ def render_doc(thing, title='Python Library Documentation: %s', forceload=0):
desc += ' in ' + name[:name.rfind('.')]
elif module and module is not object:
desc += ' in module ' + module.__name__
- elif not (inspect.ismodule(object) or
+
+ if not (inspect.ismodule(object) or
inspect.isclass(object) or
inspect.isroutine(object) or
inspect.isgetsetdescriptor(object) or
diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py
index d9670fb..ba37ec1 100644
--- a/Lib/test/test_pydoc.py
+++ b/Lib/test/test_pydoc.py
@@ -9,14 +9,6 @@ class TestDescriptions(unittest.TestCase):
doc = pydoc.render_doc(pydocfodder)
assert "pydocfodder" in doc
- def test_classic_class(self):
- class C: "Classic class"
- c = C()
- self.failUnlessEqual(pydoc.describe(C), 'class C')
- self.failUnlessEqual(pydoc.describe(c), 'instance of C')
- self.failUnless('instance of C in module test.test_pydoc'
- in pydoc.render_doc(c))
-
def test_class(self):
class C(object): "New-style class"
c = C()