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

Method test_iterable_full_diff

testing/test_assertion.py:439–450  ·  view source on GitHub ↗

Test the full diff assertion failure explanation. When verbose is False, then just a -v notice to get the diff is rendered, when verbose is True, then ndiff of the pprint is returned.

(self, left, right, expected)

Source from the content-addressed store, hash-verified

437 ],
438 )
439 def test_iterable_full_diff(self, left, right, expected) -> None:
440 """Test the full diff assertion failure explanation.
441
442 When verbose is False, then just a -v notice to get the diff is rendered,
443 when verbose is True, then ndiff of the pprint is returned.
444 """
445 expl = callequal(left, right, verbose=0)
446 assert expl is not None
447 assert expl[-1] == "Use -v to get the full diff"
448 verbose_expl = callequal(left, right, verbose=1)
449 assert verbose_expl is not None
450 assert "\n".join(verbose_expl).endswith(textwrap.dedent(expected).strip())
451
452 def test_iterable_full_diff_ci(
453 self, monkeypatch: MonkeyPatch, pytester: Pytester

Callers

nothing calls this directly

Calls 2

callequalFunction · 0.85
stripMethod · 0.80

Tested by

no test coverage detected