-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Expected
collections.iterable
but got output:
false positive
Resolves #317
- Loading branch information
Showing
3 changed files
with
56 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/test/resources/features/highlighting/inspections/py_type_checker_inspection.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
Feature: Fixes for PyTypeCheckerInspection related false positives | ||
Scenario Outline: Args Section type is iterable | ||
Given a snakemake project | ||
Given I open a file "foo.smk" with text | ||
""" | ||
rule rule_317_1: | ||
output: "d" | ||
<rule_like> rule_317_2: | ||
input: expand( | ||
[s for s in rules.rule_317_1.output], | ||
[s for s in 1], | ||
key="val" | ||
) | ||
output: "out.txt" | ||
run: | ||
with open(output[0], 'w') as out: | ||
for p in input: | ||
print(p, file=out) | ||
""" | ||
And PyTypeCheckerInspection inspection is enabled | ||
# warning only for `1`, not for `rules.rule_317_1.output` and not for `for p in input` | ||
Then I expect inspection warning on <1> in <[s for s in 1]> with message | ||
""" | ||
Expected 'collections.Iterable', got 'int' instead | ||
""" | ||
When I check highlighting warnings | ||
Examples: | ||
| rule_like | | ||
| rule | | ||
| checkpoint | |