Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
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
tests/errors/w_unused.pyx
tests/errors/w_unused.pyx
+5
-0
tests/run/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():
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'
"""
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