Skip to content

Commit b228d77

Browse files
Remove test for function inference as astroid is not ready yet
1 parent 07fc0dd commit b228d77

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

tests/functional/l/len_checks.py

+12-10
Original file line numberDiff line numberDiff line change
@@ -158,18 +158,20 @@ def function_returning_int(r):
158158
return 1
159159
return 2
160160

161-
def function_returning_generator(r):
162-
for i in [r, 1, 2, 3]:
163-
yield i
161+
# def function_returning_generator(r):
162+
# for i in [r, 1, 2, 3]:
163+
# yield i
164164

165-
def function_returning_comprehension(r):
166-
return [x+1 for x in [r, 1, 2, 3]]
165+
# def function_returning_comprehension(r):
166+
# return [x+1 for x in [r, 1, 2, 3]]
167167

168-
def function_returning_function(r):
169-
return function_returning_generator(r)
168+
# def function_returning_function(r):
169+
# return function_returning_generator(r)
170170

171171
assert len(function_returning_list(z)) # [len-as-condition]
172172
assert len(function_returning_int(z))
173-
assert len(function_returning_generator(z)) # [len-as-condition]
174-
assert len(function_returning_comprehension(z)) # [len-as-condition]
175-
assert len(function_returning_function(z)) # [len-as-condition]
173+
# This should raise a len-as-conditions once astroid can infer it
174+
# See https://github.com/PyCQA/pylint/pull/3821#issuecomment-743771514
175+
# assert len(function_returning_generator(z))
176+
# assert len(function_returning_comprehension(z))
177+
# assert len(function_returning_function(z))

tests/functional/l/len_checks.txt

-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,4 @@ len-as-condition:127:github_issue_1879:Do not use `len(SEQUENCE)` without compar
2020
len-as-condition:128:github_issue_1879:Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty
2121
len-as-condition:129:github_issue_1879:Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty
2222
len-as-condition:130:github_issue_1879:Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty
23-
len-as-condition:131:github_issue_1879:Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty
24-
len-as-condition:161:github_issue_1879:Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty
25-
len-as-condition:170:github_issue_1879:Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty
2623
len-as-condition:171:github_issue_1879:Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty

0 commit comments

Comments
 (0)