diff options
Diffstat (limited to 'tests/errors/pure_errors.py')
-rw-r--r-- | tests/errors/pure_errors.py | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/tests/errors/pure_errors.py b/tests/errors/pure_errors.py index 4a9dca53b..e348abbae 100644 --- a/tests/errors/pure_errors.py +++ b/tests/errors/pure_errors.py @@ -50,8 +50,43 @@ def pyfunc(x): # invalid return x + 1 +@cython.exceptval(-1) +@cython.cfunc +def test_cdef_return_object_broken(x: object) -> object: + return x + + +@cython.ccall +@cython.cfunc +def test_contradicting_decorators1(x: object) -> object: + return x + + +@cython.cfunc +@cython.ccall +def test_contradicting_decorators2(x: object) -> object: + return x + + +@cython.cfunc +@cython.ufunc +def add_one(x: cython.double) -> cython.double: + return x+1 + + _ERRORS = """ 44:22: Calling gil-requiring function not allowed without gil 45:24: Calling gil-requiring function not allowed without gil -49:0: Python functions cannot be declared 'nogil' +48:0: Python functions cannot be declared 'nogil' +53:0: Exception clause not allowed for function returning Python object +59:0: cfunc and ccall directives cannot be combined +65:0: cfunc and ccall directives cannot be combined +71:0: Cannot apply @cfunc to @ufunc, please reverse the decorators. +""" + +_WARNINGS = """ +30:0: Directive does not change previous value (nogil=False) +# bugs: +59:0: 'test_contradicting_decorators1' redeclared +65:0: 'test_contradicting_decorators2' redeclared """ |