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

Method test_repr_source

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

Source from the content-addressed store, hash-verified

448 return importasmod
449
450 def test_repr_source(self):
451 pr = FormattedExcinfo()
452 source = _pytest._code.Source(
453 """\
454 def f(x):
455 pass
456 """
457 ).strip()
458 pr.flow_marker = "|" # type: ignore[misc]
459 lines = pr.get_source(source, 0)
460 assert len(lines) == 2
461 assert lines[0] == "| def f(x):"
462 assert lines[1] == " pass"
463
464 def test_repr_source_excinfo(self) -> None:
465 """Check if indentation is right."""

Callers

nothing calls this directly

Calls 3

get_sourceMethod · 0.95
FormattedExcinfoClass · 0.90
stripMethod · 0.80

Tested by

no test coverage detected