summaryrefslogtreecommitdiff
path: root/tests/errors/cdef_func_decorators.pyx
diff options
context:
space:
mode:
Diffstat (limited to 'tests/errors/cdef_func_decorators.pyx')
-rw-r--r--tests/errors/cdef_func_decorators.pyx39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/errors/cdef_func_decorators.pyx b/tests/errors/cdef_func_decorators.pyx
new file mode 100644
index 000000000..e249b2e97
--- /dev/null
+++ b/tests/errors/cdef_func_decorators.pyx
@@ -0,0 +1,39 @@
+# mode: error
+# tag: decorator
+
+from functools import wraps
+
+@wraps
+cdef cant_be_decoratored():
+ pass
+
+@wraps
+cpdef also_cant_be_decorated():
+ pass
+
+cdef class C:
+ @wraps
+ cdef still_cant_be_decorated(self):
+ pass
+
+ @property
+ cdef property_only_works_for_extern_classes(self):
+ pass
+
+ @wraps
+ cpdef also_still_cant_be_decorated(self):
+ pass
+
+ @wraps
+ @wraps
+ cdef two_is_just_as_bad_as_one(self):
+ pass
+
+_ERRORS = """
+6:0: Cdef functions cannot take arbitrary decorators.
+10:0: Cdef functions cannot take arbitrary decorators.
+15:4: Cdef functions cannot take arbitrary decorators.
+19:4: Cdef functions cannot take arbitrary decorators.
+23:4: Cdef functions cannot take arbitrary decorators.
+27:4: Cdef functions cannot take arbitrary decorators.
+"""