Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
nexedi
cython
Commits
480798a6
Commit
480798a6
authored
Jul 31, 2011
by
Vitja Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add generic python args test
parent
f871cad3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
0 deletions
+58
-0
w_unused.pyx
tests/errors/w_unused.pyx
+5
-0
unused_args.pyx
tests/run/unused_args.pyx
+53
-0
No files found.
tests/errors/w_unused.pyx
View file @
480798a6
...
@@ -35,6 +35,9 @@ def unused_and_unassigned():
...
@@ -35,6 +35,9 @@ def unused_and_unassigned():
cdef object foo
cdef object foo
cdef int i
cdef int i
def unused_generic(*args, **kwargs):
pass
_ERRORS = """
_ERRORS = """
6:6: Unused entry 'a'
6:6: Unused entry 'a'
9:9: Unused entry 'b'
9:9: Unused entry 'b'
...
@@ -44,4 +47,6 @@ _ERRORS = """
...
@@ -44,4 +47,6 @@ _ERRORS = """
25:4: Unused entry 'Unused'
25:4: Unused entry 'Unused'
35:16: Unused entry 'foo'
35:16: Unused entry 'foo'
36:13: Unused entry 'i'
36:13: Unused entry 'i'
38:20: Unused argument 'args'
38:28: Unused argument 'kwargs'
"""
"""
tests/run/unused_args.pyx
0 → 100644
View file @
480798a6
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)
"""
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