MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_repr_local

Method test_repr_local

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

Source from the content-addressed store, hash-verified

532 assert repr.chain[0][0].reprentries[0].lines[0] == "> ???"
533
534 def test_repr_local(self) -> None:
535 p = FormattedExcinfo(showlocals=True)
536 loc = {"y": 5, "z": 7, "x": 3, "@x": 2, "__builtins__": {}}
537 reprlocals = p.repr_locals(loc)
538 assert reprlocals is not None
539 assert reprlocals.lines
540 assert reprlocals.lines[0] == "__builtins__ = <builtins>"
541 assert reprlocals.lines[1] == "x = 3"
542 assert reprlocals.lines[2] == "y = 5"
543 assert reprlocals.lines[3] == "z = 7"
544
545 def test_repr_local_with_error(self) -> None:
546 class ObjWithErrorInRepr:

Callers

nothing calls this directly

Calls 2

repr_localsMethod · 0.95
FormattedExcinfoClass · 0.90

Tested by

no test coverage detected