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

Function pytest_assertrepr_compare

src/_pytest/hookspec.py:629–640  ·  view source on GitHub ↗

Return explanation for comparisons in failing assert expressions. Return None for no custom explanation, otherwise return a list of strings. The strings will be joined by newlines but any newlines *in* a string will be escaped. Note that all but the first line will be indented sligh

(
    config: "Config", op: str, left: object, right: object
)

Source from the content-addressed store, hash-verified

627
628
629def pytest_assertrepr_compare(
630 config: "Config", op: str, left: object, right: object
631) -> Optional[List[str]]:
632 """Return explanation for comparisons in failing assert expressions.
633
634 Return None for no custom explanation, otherwise return a list
635 of strings. The strings will be joined by newlines but any newlines
636 *in* a string will be escaped. Note that all but the first line will
637 be indented slightly, the intention is for the first line to be a summary.
638
639 :param pytest.Config config: The pytest config object.
640 """
641
642
643def pytest_assertion_pass(item: "Item", lineno: int, orig: str, expl: str) -> None:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected