MCPcopy
hub / github.com/pytest-dev/pytest / generic_visit

Method generic_visit

src/_pytest/assertion/rewrite.py:839–843  ·  view source on GitHub ↗

Handle expressions we don't have custom code for.

(self, node: ast.AST)

Source from the content-addressed store, hash-verified

837 return ast.Name(name, ast.Load())
838
839 def generic_visit(self, node: ast.AST) -> tuple[ast.Name, str]:
840 """Handle expressions we don't have custom code for."""
841 assert isinstance(node, ast.expr)
842 res = self.assign(node)
843 return res, self.explanation_param(self.display(res))
844
845 def visit_Assert(self, assert_: ast.Assert) -> list[ast.stmt]:
846 """Return the AST statements to replace the ast.Assert instance.

Callers 1

visit_AttributeMethod · 0.95

Calls 3

assignMethod · 0.95
explanation_paramMethod · 0.95
displayMethod · 0.95

Tested by

no test coverage detected