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
381a9bce
Commit
381a9bce
authored
Mar 24, 2015
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #23571: Update test_capi
parent
e0deff31
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
2 deletions
+23
-2
Lib/test/test_capi.py
Lib/test/test_capi.py
+23
-2
No files found.
Lib/test/test_capi.py
View file @
381a9bce
...
...
@@ -184,7 +184,15 @@ class CAPITest(unittest.TestCase):
_testcapi.return_null_without_error()
"""
)
rc
,
out
,
err
=
assert_python_failure
(
'-c'
,
code
)
self
.
assertIn
(
b'_Py_CheckFunctionResult'
,
err
)
self
.
assertRegex
(
err
.
replace
(
b'
\
r
'
,
b''
),
br'Fatal Python error: '
br'Function result is invalid\n'
br'SystemError: <built-in function '
br'return_null_without_error> returned NULL '
br'without setting an error\n'
br'\n'
br'Current thread.*:\n'
br' File .*", line 6 in <module>'
)
else
:
with
self
.
assertRaises
(
SystemError
)
as
cm
:
_testcapi
.
return_null_without_error
()
...
...
@@ -203,7 +211,20 @@ class CAPITest(unittest.TestCase):
_testcapi.return_result_with_error()
"""
)
rc
,
out
,
err
=
assert_python_failure
(
'-c'
,
code
)
self
.
assertIn
(
b'_Py_CheckFunctionResult'
,
err
)
self
.
assertRegex
(
err
.
replace
(
b'
\
r
'
,
b''
),
br'Fatal Python error: '
br'Function result is invalid\n'
br'ValueError\n'
br'\n'
br'During handling of the above exception, '
br'another exception occurred:\n'
br'\n'
br'SystemError: <built-in '
br'function return_result_with_error> '
br'returned a result with an error set\n'
br'\n'
br'Current thread.*:\n'
br' File .*, line 6 in <module>'
)
else
:
with
self
.
assertRaises
(
SystemError
)
as
cm
:
_testcapi
.
return_result_with_error
()
...
...
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