Skip to content

Commit 2fbd5c5

Browse files
authored
Fix PyLint Comprehension Expressions (#38)
These are un-needed comprehension expressions that should just use list method Signed-off-by: David Brown <dmlb2000@gmail.com>
1 parent b1bb699 commit 2fbd5c5

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tests/expression_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def test_failure_expressions(self):
3636
]:
3737
print(path)
3838
expr = Path.parse_str(path)
39-
self.assertFalse([x for x in expr.match(data)])
39+
self.assertFalse(list(expr.match(data)))
4040

4141
def test_unary_operator(self):
4242
"""Test the unary not in a path."""
@@ -48,7 +48,7 @@ def test_unary_operator(self):
4848
]
4949
expr = Path.parse_str('$[?(not @.bar)]')
5050
self.assertEqual(Path.parse_str(str(expr)), expr)
51-
self.assertTrue([x for x in expr.match(data)])
51+
self.assertTrue(list(expr.match(data)))
5252

5353
def test_unary_boolean_operator(self):
5454
"""Test the unary not in a path."""
@@ -60,7 +60,7 @@ def test_unary_boolean_operator(self):
6060
]
6161
expr = Path.parse_str('$[?(not (@.bar or (@.fiz > 2 and @.biz > 2)))]')
6262
self.assertEqual(Path.parse_str(str(expr)), expr)
63-
self.assertTrue([x for x in expr.match(data)])
63+
self.assertTrue(list(expr.match(data)))
6464

6565
def test_variadic_operator(self):
6666
"""Test a variadic operator."""

0 commit comments

Comments
 (0)