Skip to content

Commit 3174e37

Browse files
Merge remote-tracking branch 'BergLucas/fix/syntax-tree-analyser'
2 parents 2febbcb + 46475da commit 3174e37

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/pynguin/analyses/syntaxtree.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ def context(self) -> _Context:
319319
def visit_Raise(self, node: ast.Raise) -> ast.AST: # noqa: N802
320320
bubbles = self.context.add_exception(node)
321321
if bubbles:
322-
assert len(self.contexts) > 1
322+
assert len(self.contexts) >= 1
323323
if len(self.contexts) < 2:
324324
return self.generic_visit(node)
325325
parent_context = self.contexts[-2]
@@ -378,7 +378,11 @@ def visit_Assert(self, node: ast.Assert) -> ast.AST: # noqa: N802
378378
# exceptions.
379379
self.visit_Raise(
380380
ast.Raise(
381-
exc=ast.Call(func=ast.Name(id="AssertionError", ctx=ast.Load())),
381+
exc=ast.Call(
382+
func=ast.Name(id="AssertionError", ctx=ast.Load()),
383+
args=[],
384+
keywords=[],
385+
),
382386
)
383387
)
384388
# Make sure that we also execute a visit_Assert method in another analysis

0 commit comments

Comments
 (0)