diff options
author | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2008-04-24 21:00:04 +0000 |
---|---|---|
committer | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2008-04-24 21:00:04 +0000 |
commit | b908467e23de983449e97fc6d253b277101d01ef (patch) | |
tree | 8c56e114ba00589fe48c707e31bdacdfddfb58cd /Lib | |
parent | dca212eaa06324abb28e8cd804dce77fcebb99ba (diff) | |
download | cpython-b908467e23de983449e97fc6d253b277101d01ef.tar.gz |
Correct recently merged tests:
- two bugs in pydoc.py
- remove test about classic classes
Diffstat (limited to 'Lib')
-rwxr-xr-x | Lib/pydoc.py | 7 | ||||
-rw-r--r-- | Lib/test/test_pydoc.py | 8 |
2 files changed, 4 insertions, 11 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py index fbad574c2d..31122e1657 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 d9670fbbe8..ba37ec12fe 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()
|