Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
6759b3bb
Commit
6759b3bb
authored
Sep 23, 2017
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Failing tests for automatic exception values.
parent
7cac3e06
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
0 deletions
+35
-0
tests/run/cpp_bool.pyx
tests/run/cpp_bool.pyx
+20
-0
tests/run/exceptionpropagation.pyx
tests/run/exceptionpropagation.pyx
+15
-0
No files found.
tests/run/cpp_bool.pyx
View file @
6759b3bb
...
...
@@ -19,3 +19,23 @@ def test_bool(bool a):
False
"""
return
a
cdef
bool
may_raise_exception
(
bool
value
,
exception
)
except
*
:
if
exception
:
raise
exception
else
:
return
value
def
test_may_raise_exception
(
bool
value
,
exception
=
None
):
"""
>>> test_may_raise_exception(False)
False
>>> test_may_raise_exception(True)
True
>>> test_may_raise_exception(True, RuntimeError)
Traceback (most recent call last):
...
RuntimeError
"""
return
may_raise_exception
(
value
,
exception
)
tests/run/exceptionpropagation.pyx
View file @
6759b3bb
...
...
@@ -42,3 +42,18 @@ def test_except_big_result(bint fire):
RuntimeError
"""
except_big_result
(
fire
)
cdef
unsigned
short
except_promotion_compare
(
bint
fire
)
except
*
:
if
fire
:
raise
RuntimeError
def
test_except_promotion_compare
(
bint
fire
):
"""
>>> test_except_promotion_compare(False)
>>> test_except_promotion_compare(True)
Traceback (most recent call last):
...
RuntimeError
"""
except_promotion_compare
(
fire
)
\ No newline at end of file
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