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

Method test_repr_local

testing/code/test_excinfo.py:706–715  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

704 assert repr.chain[0][0].reprentries[0].lines[0] == "> ???"
705
706 def test_repr_local(self) -> None:
707 p = ExceptionInfoFormatter(showlocals=True)
708 loc = {"y": 5, "z": 7, "x": 3, "@x": 2, "__builtins__": {}}
709 reprlocals = p.repr_locals(loc)
710 assert reprlocals is not None
711 assert reprlocals.lines
712 assert reprlocals.lines[0] == "__builtins__ = <builtins>"
713 assert reprlocals.lines[1] == "x = 3"
714 assert reprlocals.lines[2] == "y = 5"
715 assert reprlocals.lines[3] == "z = 7"
716
717 def test_repr_local_with_error(self) -> None:
718 class ObjWithErrorInRepr:

Callers

nothing calls this directly

Calls 2

repr_localsMethod · 0.95

Tested by

no test coverage detected