Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 768db92

Browse files
committed
Correct recently merged tests:
- two bugs in pydoc.py - remove test about classic classes
1 parent 8c03b4d commit 768db92

2 files changed

Lines changed: 4 additions & 11 deletions

File tree

Lib/pydoc.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python
2-
# -*- coding: Latin-1 -*-
2+
# -*- coding: latin-1 -*-
33
"""Generate Python documentation in HTML or text for interactive use.
44
55
In the Python interpreter, do "from pydoc import help" to provide online
@@ -1074,7 +1074,7 @@ def docmodule(self, object, name=None, mod=None):
10741074
if submodules:
10751075
submodules.sort()
10761076
result = result + self.section(
1077-
'SUBMODULES', join(submodules, '\n'))
1077+
'SUBMODULES', '\n'.join(submodules))
10781078

10791079
if classes:
10801080
classlist = [value for key, value in classes]
@@ -1484,7 +1484,8 @@ def render_doc(thing, title='Python Library Documentation: %s', forceload=0):
14841484
desc += ' in ' + name[:name.rfind('.')]
14851485
elif module and module is not object:
14861486
desc += ' in module ' + module.__name__
1487-
elif not (inspect.ismodule(object) or
1487+
1488+
if not (inspect.ismodule(object) or
14881489
inspect.isclass(object) or
14891490
inspect.isroutine(object) or
14901491
inspect.isgetsetdescriptor(object) or

Lib/test/test_pydoc.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,6 @@ def test_module(self):
99
doc = pydoc.render_doc(pydocfodder)
1010
assert "pydocfodder" in doc
1111

12-
def test_classic_class(self):
13-
class C: "Classic class"
14-
c = C()
15-
self.failUnlessEqual(pydoc.describe(C), 'class C')
16-
self.failUnlessEqual(pydoc.describe(c), 'instance of C')
17-
self.failUnless('instance of C in module test.test_pydoc'
18-
in pydoc.render_doc(c))
19-
2012
def test_class(self):
2113
class C(object): "New-style class"
2214
c = C()

0 commit comments

Comments
 (0)