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

Method visit_UnaryOp

src/_pytest/assertion/rewrite.py:1034–1038  ·  view source on GitHub ↗
(self, unary: ast.UnaryOp)

Source from the content-addressed store, hash-verified

1032 return ast.Name(res_var, ast.Load()), self.explanation_param(expl)
1033
1034 def visit_UnaryOp(self, unary: ast.UnaryOp) -> tuple[ast.Name, str]:
1035 pattern = UNARY_MAP[unary.op.__class__]
1036 operand_res, operand_expl = self.visit(unary.operand)
1037 res = self.assign(ast.copy_location(ast.UnaryOp(unary.op, operand_res), unary))
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__]

Callers

nothing calls this directly

Calls 2

assignMethod · 0.95
visitMethod · 0.80

Tested by

no test coverage detected