Skip to content

Commit

Permalink
Fix CLI fails when running on the tests
Browse files Browse the repository at this point in the history
Running:
  precli -r tests

Yields the following error:

  TypeError: all() takes exactly one argument (3 given)

The recent change to is_test_code() is not using a collection
passed to the all() function.

Signed-off-by: Eric Brown <[email protected]>
  • Loading branch information
ericwb committed Oct 26, 2024
1 parent fc9515b commit fb5fa8d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions precli/parsers/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,11 @@ def is_test_code(self) -> bool:
path = pathlib.Path(self.context["artifact"].file_name)

return all(
"tests" in path.parts,
path.name.startswith("test_"),
self.current_symtab.name().startswith("test_"),
[
"tests" in path.parts,
path.name.startswith("test_"),
self.current_symtab.name().startswith("test_"),
]
)

def visit_module(self, nodes: list[Node]):
Expand Down

0 comments on commit fb5fa8d

Please sign in to comment.