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

Method visit_BinOp

src/_pytest/assertion/rewrite.py:1040–1048  ·  view source on GitHub ↗
(self, binop: ast.BinOp)

Source from the content-addressed store, hash-verified

1038 return res, pattern % (operand_expl,)
1039
1040 def visit_BinOp(self, binop: ast.BinOp) -> tuple[ast.Name, str]:
1041 symbol = BINOP_MAP[binop.op.__class__]
1042 left_expr, left_expl = self.visit(binop.left)
1043 right_expr, right_expl = self.visit(binop.right)
1044 explanation = f"({left_expl} {symbol} {right_expl})"
1045 res = self.assign(
1046 ast.copy_location(ast.BinOp(left_expr, binop.op, right_expr), binop)
1047 )
1048 return res, explanation
1049
1050 def visit_Call(self, call: ast.Call) -> tuple[ast.Name, str]:
1051 new_func, func_expl = self.visit(call.func)

Callers

nothing calls this directly

Calls 2

assignMethod · 0.95
visitMethod · 0.80

Tested by

no test coverage detected