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
bda5bac1
Commit
bda5bac1
authored
Nov 23, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix AutoTestDictTransform for lambda expressions
parent
343f9796
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
Cython/Compiler/AnalysedTreeTransforms.py
Cython/Compiler/AnalysedTreeTransforms.py
+5
-0
tests/run/autotestdict.pyx
tests/run/autotestdict.pyx
+5
-4
No files found.
Cython/Compiler/AnalysedTreeTransforms.py
View file @
bda5bac1
...
@@ -57,6 +57,11 @@ class AutoTestDictTransform(ScopeTrackingTransform):
...
@@ -57,6 +57,11 @@ class AutoTestDictTransform(ScopeTrackingTransform):
value
=
UnicodeNode
(
pos
,
value
=
doctest
)
value
=
UnicodeNode
(
pos
,
value
=
doctest
)
self
.
tests
.
append
(
DictItemNode
(
pos
,
key
=
key
,
value
=
value
))
self
.
tests
.
append
(
DictItemNode
(
pos
,
key
=
key
,
value
=
value
))
def
visit_ExprNode
(
self
,
node
):
# expressions cannot contain functions and lambda expressions
# do not have a docstring
return
node
def
visit_FuncDefNode
(
self
,
node
):
def
visit_FuncDefNode
(
self
,
node
):
if
not
node
.
doc
:
if
not
node
.
doc
:
return
node
return
node
...
...
tests/run/autotestdict.pyx
View file @
bda5bac1
...
@@ -10,10 +10,10 @@ all_tests_run() is executed which does final validation.
...
@@ -10,10 +10,10 @@ all_tests_run() is executed which does final validation.
>>> items.sort()
>>> items.sort()
>>> for key, value in items:
>>> for key, value in items:
... print('%s ; %s' % (key, value))
... print('%s ; %s' % (key, value))
MyCdefClass.cpdef_method (line 7
6
) ; >>> add_log("cpdef class method")
MyCdefClass.cpdef_method (line 7
7
) ; >>> add_log("cpdef class method")
MyCdefClass.method (line 7
3
) ; >>> add_log("cdef class method")
MyCdefClass.method (line 7
4
) ; >>> add_log("cdef class method")
MyClass.method (line 6
2
) ; >>> add_log("class method")
MyClass.method (line 6
3
) ; >>> add_log("class method")
mycpdeffunc (line
49
) ; >>> add_log("cpdef")
mycpdeffunc (line
50
) ; >>> add_log("cpdef")
myfunc (line 40) ; >>> add_log("def")
myfunc (line 40) ; >>> add_log("def")
"""
"""
...
@@ -39,6 +39,7 @@ def add_log(s):
...
@@ -39,6 +39,7 @@ def add_log(s):
def
myfunc
():
def
myfunc
():
""">>> add_log("def")"""
""">>> add_log("def")"""
x
=
lambda
a
:
1
# no docstring here ...
def
doc_without_test
():
def
doc_without_test
():
"""Some docs"""
"""Some docs"""
...
...
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