Skip to content

Commit

Permalink
Add test to superfluous-parens
Browse files Browse the repository at this point in the history
Additional test based on a suggestion in #4907
  • Loading branch information
DanielNoord authored and Pierre-Sassoulas committed Sep 2, 2021
1 parent e49c3b1 commit 0981d8b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/functional/s/super/superfluous_parens.py
Expand Up @@ -41,6 +41,9 @@
def function_A():
return (x for x in ((3, 4)))

def function_B(var):
return (var.startswith(('A', 'B', 'C')) or var == 'D')

# TODO: Test string combinations, see https://github.com/PyCQA/pylint/issues/4792
# Lines 45, 46 & 47 should raise the superfluous-parens message
J = "TestString"
Expand All @@ -49,11 +52,11 @@ def function_A():
assert "" + ("Version " + "String") in I

# Test numpy
def function_B(var_1: int, var_2: int) -> np.ndarray:
def function_numpy_A(var_1: int, var_2: int) -> np.ndarray:
result = (((var_1 & var_2)) > 0)
return result.astype(np.float32)

def function_C(var_1: int, var_2: int) -> np.ndarray:
def function_numpy_B(var_1: int, var_2: int) -> np.ndarray:
return (((var_1 & var_2)) > 0).astype(np.float32)

# Test Class
Expand Down

0 comments on commit 0981d8b

Please sign in to comment.