Skip to content

Commit

Permalink
Fix functional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielNoord committed Aug 1, 2021
1 parent 33bdace commit 137e469
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pylint/checkers/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ def _check_keyword_parentheses(
self.add_message(
"superfluous-parens", line=line_num, args=keyword_token
)
continue
return
# ')' can't happen after if (foo), since it would be a syntax error.
if tokens[i + 1].string in (":", ")", "]", "}", "in") or tokens[
i + 1
Expand Down
4 changes: 2 additions & 2 deletions tests/checkers/unittest_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,9 @@ def test_disable_global_option_end_of_line():
Test for issue with disabling tokenizer messages
that extend beyond the scope of the ast tokens
"""
file_ = tempfile.NamedTemporaryFile( # pylint: disable=consider-using-with
file_ = tempfile.NamedTemporaryFile(
"w", delete=False
)
) # pylint: disable=consider-using-with
with file_:
file_.write(
"""
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/s/superfluous_parens.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
del DICT["b"]
del DICT["a"]

i = [x for x in ((3, 4) if 1 else (5, 6))]
i = [x for x in ((3, 4) if 1 > 0 else (5, 6))]
i = [x for x in ((3, 4))] # [superfluous-parens]


Expand Down
2 changes: 1 addition & 1 deletion tests/functional/s/superfluous_parens.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
superfluous-parens:8:0::Unnecessary parens after 'not' keyword
superfluous-parens:14:0::Unnecessary parens after 'if' keyword
superfluous-parens:23:0::Unnecessary parens after 'in' keyword
superfluous-parens:25:0::Unnecessary parens after 'in' keyword
superfluous-parens:27:0::Unnecessary parens after 'in' keyword
2 changes: 1 addition & 1 deletion tests/functional/s/superfluous_parens_walrus_py38.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
superfluous-parens:4:0::Unnecessary parens after 'in' keyword
superfluous-parens:6:0::Unnecessary parens after 'not' keyword

0 comments on commit 137e469

Please sign in to comment.