Skip to content

Commit

Permalink
Merge remote-tracking branch 'BergLucas/fix/syntax-tree-analyser'
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanlukasczyk committed Jun 14, 2024
2 parents 2febbcb + 46475da commit 3174e37
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/pynguin/analyses/syntaxtree.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def context(self) -> _Context:
def visit_Raise(self, node: ast.Raise) -> ast.AST: # noqa: N802
bubbles = self.context.add_exception(node)
if bubbles:
assert len(self.contexts) > 1
assert len(self.contexts) >= 1
if len(self.contexts) < 2:
return self.generic_visit(node)
parent_context = self.contexts[-2]
Expand Down Expand Up @@ -378,7 +378,11 @@ def visit_Assert(self, node: ast.Assert) -> ast.AST: # noqa: N802
# exceptions.
self.visit_Raise(
ast.Raise(
exc=ast.Call(func=ast.Name(id="AssertionError", ctx=ast.Load())),
exc=ast.Call(
func=ast.Name(id="AssertionError", ctx=ast.Load()),
args=[],
keywords=[],
),
)
)
# Make sure that we also execute a visit_Assert method in another analysis
Expand Down

0 comments on commit 3174e37

Please sign in to comment.