diff --git a/tests/errors/w_unused.pyx b/tests/errors/w_unused.pyx index 8024e81ce26d1c2b8a4e01deb0f529a98ae040c7..b3c1581a01f56a9866ade0e9400a9ce4b0872975 100644 --- a/tests/errors/w_unused.pyx +++ b/tests/errors/w_unused.pyx @@ -35,6 +35,9 @@ def unused_and_unassigned(): cdef object foo cdef int i +def unused_generic(*args, **kwargs): + pass + _ERRORS = """ 6:6: Unused entry 'a' 9:9: Unused entry 'b' @@ -44,4 +47,6 @@ _ERRORS = """ 25:4: Unused entry 'Unused' 35:16: Unused entry 'foo' 36:13: Unused entry 'i' +38:20: Unused argument 'args' +38:28: Unused argument 'kwargs' """ diff --git a/tests/run/unused_args.pyx b/tests/run/unused_args.pyx new file mode 100644 index 0000000000000000000000000000000000000000..7bb4b60e6bb25fe1153acbf73a1f41be0eea619f --- /dev/null +++ b/tests/run/unused_args.pyx @@ -0,0 +1,53 @@ +cdef c_unused_simple(a, b, c): + """ + >>> c_unused_simple(1, 2, 3) + 3 + """ + return a + b + +cdef c_unused_optional(a, b, c=1, d=2): + """ + >>> c_unused_optional(1, 2) + 4 + >>> c_unused_optional(1, 2, 3, 4) + 6 + """ + return b + d + +cpdef cp_unused_simple(a, b, c): + """ + >>> cp_unused_simple(1, 2, 3) + 3 + """ + return a + b + +cpdef cp_unused_optional(a, b, c=1, d=2): + """ + >>> cp_unused_optional(1, 2) + 4 + >>> cp_unused_optional(1, 2, 3, 4) + 6 + """ + return b + d + + +cdef class Unused: + """ + >>> o = Unused() + """ + + cpdef cp_unused_simple(self, a, b, c): + return c + + cpdef cp_unused_optional(self, a, b, c=1, d=2): + return b + d + +def def_unused(a, b, c): + """ + >>> def_unused(1, 2, 3) + """ + +def def_unused_metho(o): + """ + >>> def_unused_metho(0) + """