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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
888abee0
Commit
888abee0
authored
May 04, 2011
by
Vitja Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add CF testcases for generators and with statement
parent
257e19b0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
0 deletions
+34
-0
tests/errors/w_uninitialized_generators.pyx
tests/errors/w_uninitialized_generators.pyx
+12
-0
tests/errors/w_uninitialized_with.pyx
tests/errors/w_uninitialized_with.pyx
+22
-0
No files found.
tests/errors/w_uninitialized_generators.pyx
0 → 100644
View file @
888abee0
# cython: warn.maybe_uninitialized=True
# mode: error
# tag: werror
def
unbound_inside_generator
(
*
args
):
for
i
in
args
:
yield
x
x
=
i
+
i
_ERRORS
=
"""
7:15: local variable 'x' might be referenced before assignment
"""
tests/errors/w_uninitialized_with.pyx
0 → 100644
View file @
888abee0
# cython: warn.maybe_uninitialized=True
# mode: error
# tag: werror
def
with_no_target
(
m
):
with
m
:
print
a
a
=
1
def
unbound_manager
(
m1
):
with
m2
:
pass
m2
=
m1
def
with_target
(
m
):
with
m
as
f
:
print
(
f
)
_ERRORS
=
"""
7:15: local variable 'a' referenced before assignment
11:11: local variable 'm2' referenced before assignment
"""
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