Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
768db92b
Commit
768db92b
authored
Apr 24, 2008
by
Amaury Forgeot d'Arc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct recently merged tests:
- two bugs in pydoc.py - remove test about classic classes
parent
8c03b4de
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
11 deletions
+4
-11
Lib/pydoc.py
Lib/pydoc.py
+4
-3
Lib/test/test_pydoc.py
Lib/test/test_pydoc.py
+0
-8
No files found.
Lib/pydoc.py
View file @
768db92b
#!/usr/bin/env python
#!/usr/bin/env python
# -*- coding:
L
atin-1 -*-
# -*- coding:
l
atin-1 -*-
"""Generate Python documentation in HTML or text for interactive use.
"""Generate Python documentation in HTML or text for interactive use.
In the Python interpreter, do "from pydoc import help" to provide online
In the Python interpreter, do "from pydoc import help" to provide online
...
@@ -1074,7 +1074,7 @@ class TextDoc(Doc):
...
@@ -1074,7 +1074,7 @@ class TextDoc(Doc):
if
submodules
:
if
submodules
:
submodules
.
sort
()
submodules
.
sort
()
result
=
result
+
self
.
section
(
result
=
result
+
self
.
section
(
'SUBMODULES'
,
join
(
submodules
,
'
\
n
'
))
'SUBMODULES'
,
'
\
n
'
.
join
(
submodules
))
if
classes
:
if
classes
:
classlist
=
[
value
for
key
,
value
in
classes
]
classlist
=
[
value
for
key
,
value
in
classes
]
...
@@ -1484,7 +1484,8 @@ def render_doc(thing, title='Python Library Documentation: %s', forceload=0):
...
@@ -1484,7 +1484,8 @@ def render_doc(thing, title='Python Library Documentation: %s', forceload=0):
desc
+=
' in '
+
name
[:
name
.
rfind
(
'.'
)]
desc
+=
' in '
+
name
[:
name
.
rfind
(
'.'
)]
elif
module
and
module
is
not
object
:
elif
module
and
module
is
not
object
:
desc
+=
' in module '
+
module
.
__name__
desc
+=
' in module '
+
module
.
__name__
elif
not
(
inspect
.
ismodule
(
object
)
or
if
not
(
inspect
.
ismodule
(
object
)
or
inspect
.
isclass
(
object
)
or
inspect
.
isclass
(
object
)
or
inspect
.
isroutine
(
object
)
or
inspect
.
isroutine
(
object
)
or
inspect
.
isgetsetdescriptor
(
object
)
or
inspect
.
isgetsetdescriptor
(
object
)
or
...
...
Lib/test/test_pydoc.py
View file @
768db92b
...
@@ -9,14 +9,6 @@ class TestDescriptions(unittest.TestCase):
...
@@ -9,14 +9,6 @@ class TestDescriptions(unittest.TestCase):
doc
=
pydoc
.
render_doc
(
pydocfodder
)
doc
=
pydoc
.
render_doc
(
pydocfodder
)
assert
"pydocfodder"
in
doc
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
):
def
test_class
(
self
):
class
C
(
object
):
"New-style class"
class
C
(
object
):
"New-style class"
c
=
C
()
c
=
C
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment