Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions codeflash/code_utils/edit_generated_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __init__(

def visit_ClassDef(self, node: ast.ClassDef) -> ast.ClassDef:
self.context_stack.append(node.name)
for inner_node in ast.walk(node):
for inner_node in node.body:
if isinstance(inner_node, (ast.FunctionDef, ast.AsyncFunctionDef)):
self.visit_FunctionDef(inner_node)
self.context_stack.pop()
Expand All @@ -55,7 +55,9 @@ def visit_FunctionDef(self, node: ast.FunctionDef) -> ast.FunctionDef:
def visit_AsyncFunctionDef(self, node: ast.AsyncFunctionDef) -> ast.AsyncFunctionDef:
return self._process_function_def(node)

def _process_function_def(self, node: ast.FunctionDef | ast.AsyncFunctionDef) -> ast.FunctionDef | ast.AsyncFunctionDef:
def _process_function_def(
self, node: ast.FunctionDef | ast.AsyncFunctionDef
) -> ast.FunctionDef | ast.AsyncFunctionDef:
self.context_stack.append(node.name)
i = len(node.body) - 1
test_qualified_name = ".".join(self.context_stack)
Expand Down
Loading