mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-16 02:27:06 +08:00
new way of gathering statements to evaluate for static analysis
This commit is contained in:
@@ -44,9 +44,26 @@ c.something = None
|
||||
something = a
|
||||
something
|
||||
|
||||
# -----------------
|
||||
# Unused array variables should still raise attribute errors.
|
||||
# -----------------
|
||||
|
||||
# should not raise anything.
|
||||
for loop_variable in [1, 2]:
|
||||
#! name-error
|
||||
x = undefined
|
||||
loop_variable
|
||||
|
||||
#! name-error
|
||||
for loop_variable in [1, 2, undefined]:
|
||||
pass
|
||||
|
||||
#! attribute-error
|
||||
[1, ''.undefined_attr]
|
||||
|
||||
|
||||
def return_one(something):
|
||||
return 1
|
||||
|
||||
#! attribute-error
|
||||
return_one(''.undefined_attribute)
|
||||
|
||||
@@ -15,7 +15,7 @@ def assert_case_equal(case, actual, desired):
|
||||
"""
|
||||
assert actual == desired, """
|
||||
Test %r failed.
|
||||
actual = %s
|
||||
actual = %s
|
||||
desired = %s
|
||||
""" % (case, actual, desired)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user