Commit 990cb64b authored by Vitja Makarov's avatar Vitja Makarov

Add some more CF tests

parent 07c389f4
...@@ -62,6 +62,18 @@ def from_import(): ...@@ -62,6 +62,18 @@ def from_import():
print bar print bar
from foo import bar from foo import bar
def regular_import():
print foo
import foo
def raise_stat():
try:
raise exc, msg
except:
pass
exc = ValueError
msg = 'dummy'
_ERRORS = """ _ERRORS = """
6:11: local variable 'a' referenced before assignment 6:11: local variable 'a' referenced before assignment
12:12: local variable 'a' might be referenced before assignment 12:12: local variable 'a' might be referenced before assignment
...@@ -70,4 +82,7 @@ _ERRORS = """ ...@@ -70,4 +82,7 @@ _ERRORS = """
58:11: local variable 'a' referenced before assignment 58:11: local variable 'a' referenced before assignment
58:14: local variable 'b' referenced before assignment 58:14: local variable 'b' referenced before assignment
62:13: local variable 'bar' referenced before assignment 62:13: local variable 'bar' referenced before assignment
66:13: local variable 'foo' referenced before assignment
71:17: local variable 'exc' referenced before assignment
71:22: local variable 'msg' referenced before assignment
""" """
...@@ -31,6 +31,10 @@ def used(x, y): ...@@ -31,6 +31,10 @@ def used(x, y):
y[0] = 1 y[0] = 1
lambda x: x lambda x: x
def unused_and_unassigned():
cdef object foo
cdef int i
_ERRORS = """ _ERRORS = """
6:6: Unused entry 'a' 6:6: Unused entry 'a'
9:9: Unused entry 'b' 9:9: Unused entry 'b'
...@@ -38,4 +42,6 @@ _ERRORS = """ ...@@ -38,4 +42,6 @@ _ERRORS = """
16:6: Unused result in 'r' 16:6: Unused result in 'r'
21:4: Unused entry 'unused_one' 21:4: Unused entry 'unused_one'
25:4: Unused entry 'Unused' 25:4: Unused entry 'Unused'
35:16: Unused entry 'foo'
36:13: Unused entry 'i'
""" """
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment