From fb5fa8d1c6e8b24877274f28e6f900f260a21260 Mon Sep 17 00:00:00 2001 From: Eric Brown Date: Fri, 25 Oct 2024 22:29:45 -0700 Subject: [PATCH] Fix CLI fails when running on the tests 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 --- precli/parsers/python.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/precli/parsers/python.py b/precli/parsers/python.py index ab63eae2..ce675179 100644 --- a/precli/parsers/python.py +++ b/precli/parsers/python.py @@ -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]):