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
455f2961
Commit
455f2961
authored
Mar 19, 2013
by
R David Murray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#17464: improve pydoc test coverage.
Patch by Matt Bachmann.
parent
41518b4a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
1 deletion
+26
-1
Lib/test/test_pydoc.py
Lib/test/test_pydoc.py
+25
-0
Misc/ACKS
Misc/ACKS
+1
-1
No files found.
Lib/test/test_pydoc.py
View file @
455f2961
...
...
@@ -395,6 +395,31 @@ class PydocDocTest(unittest.TestCase):
synopsis
=
pydoc
.
synopsis
(
TESTFN
,
{})
self
.
assertEqual
(
synopsis
,
'line 1: h
\
xe9
'
)
def
test_splitdoc_with_description
(
self
):
example_string
=
"I Am A Doc
\
n
\
n
\
n
Here is my description"
self
.
assertEqual
(
pydoc
.
splitdoc
(
example_string
),
(
'I Am A Doc'
,
'
\
n
Here is my description'
))
def
test_is_object_or_method
(
self
):
doc
=
pydoc
.
Doc
()
# Bound Method
self
.
assertTrue
(
pydoc
.
_is_some_method
(
doc
.
fail
))
# Method Descriptor
self
.
assertTrue
(
pydoc
.
_is_some_method
(
int
.
__add__
))
# String
self
.
assertFalse
(
pydoc
.
_is_some_method
(
"I am not a method"
))
def
test_is_package_when_not_package
(
self
):
with
test
.
support
.
temp_cwd
()
as
test_dir
:
self
.
assertFalse
(
pydoc
.
ispackage
(
test_dir
))
def
test_is_package_when_is_package
(
self
):
with
test
.
support
.
temp_cwd
()
as
test_dir
:
init_path
=
os
.
path
.
join
(
test_dir
,
'__init__.py'
)
open
(
init_path
,
'w'
).
close
()
self
.
assertTrue
(
pydoc
.
ispackage
(
test_dir
))
os
.
remove
(
init_path
)
class
PydocImportTest
(
unittest
.
TestCase
):
...
...
Misc/ACKS
View file @
455f2961
...
...
@@ -56,6 +56,7 @@ John Aycock
Donovan Baarda
Arne Babenhauserheide
Attila Babo
Matt Bachmann
Marcin Bachry
Alfonso Baciero
Dwayne Bailey
...
...
@@ -1364,4 +1365,3 @@ Cheng Zhang
Kai Zhu
Tarek Ziadé
Peter Åstrand
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