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
667a5138
Commit
667a5138
authored
Nov 23, 2013
by
Larry Hastings
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix inspect.signature tests for builtins when docstrings are compiled out.
parent
b064a0e7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
Lib/test/test_capi.py
Lib/test/test_capi.py
+3
-0
Lib/test/test_inspect.py
Lib/test/test_inspect.py
+6
-1
No files found.
Lib/test/test_capi.py
View file @
667a5138
...
...
@@ -9,6 +9,7 @@ import sys
import
time
import
unittest
from
test
import
support
from
test.support
import
MISSING_C_DOCSTRINGS
try
:
import
_posixsubprocess
except
ImportError
:
...
...
@@ -109,6 +110,8 @@ class CAPITest(unittest.TestCase):
self
.
assertRaises
(
TypeError
,
_posixsubprocess
.
fork_exec
,
Z
(),[
b'1'
],
3
,[
1
,
2
],
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
)
@
unittest
.
skipIf
(
MISSING_C_DOCSTRINGS
,
"Signature information for builtins requires docstrings"
)
def
test_docstring_signature_parsing
(
self
):
self
.
assertEqual
(
_testcapi
.
no_docstring
.
__doc__
,
None
)
...
...
Lib/test/test_inspect.py
View file @
667a5138
...
...
@@ -17,6 +17,7 @@ except ImportError:
ThreadPoolExecutor
=
None
from
test.support
import
run_unittest
,
TESTFN
,
DirsOnSysPath
from
test.support
import
MISSING_C_DOCSTRINGS
from
test.script_helper
import
assert_python_ok
,
assert_python_failure
from
test
import
inspect_fodder
as
mod
from
test
import
inspect_fodder2
as
mod2
...
...
@@ -1579,7 +1580,7 @@ class TestSignatureObject(unittest.TestCase):
(
'kwargs'
,
...,
int
,
"var_keyword"
)),
...))
def
test_signature_on_
builtin_function
(
self
):
def
test_signature_on_
unsupported_builtins
(
self
):
with
self
.
assertRaisesRegex
(
ValueError
,
'not supported by signature'
):
inspect
.
signature
(
type
)
with
self
.
assertRaisesRegex
(
ValueError
,
'not supported by signature'
):
...
...
@@ -1588,6 +1589,10 @@ class TestSignatureObject(unittest.TestCase):
with
self
.
assertRaisesRegex
(
ValueError
,
'not supported by signature'
):
# support for 'method-wrapper'
inspect
.
signature
(
min
.
__call__
)
@
unittest
.
skipIf
(
MISSING_C_DOCSTRINGS
,
"Signature information for builtins requires docstrings"
)
def
test_signature_on_builtins
(
self
):
self
.
assertEqual
(
inspect
.
signature
(
min
),
None
)
signature
=
inspect
.
signature
(
os
.
stat
)
self
.
assertTrue
(
isinstance
(
signature
,
inspect
.
Signature
))
...
...
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