diff options
Diffstat (limited to 'tests/run/exceptionpropagation.pyx')
-rw-r--r-- | tests/run/exceptionpropagation.pyx | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/run/exceptionpropagation.pyx b/tests/run/exceptionpropagation.pyx index 2c79bf26e..2466550d5 100644 --- a/tests/run/exceptionpropagation.pyx +++ b/tests/run/exceptionpropagation.pyx @@ -56,4 +56,26 @@ def test_except_promotion_compare(bint fire): ... RuntimeError """ - except_promotion_compare(fire)
\ No newline at end of file + except_promotion_compare(fire) + + +cdef int cdef_function_that_raises(): + raise RuntimeError + +cdef int cdef_noexcept_function_that_raises() noexcept: + raise RuntimeError + +def test_except_raise_by_default(): + """ + >>> test_except_raise_by_default() + Traceback (most recent call last): + ... + RuntimeError + """ + cdef_function_that_raises() + +def test_noexcept(): + """ + >>> test_noexcept() + """ + cdef_noexcept_function_that_raises() |