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

Method test_iterable_full_diff

testing/test_assertion.py:654–665  ·  testing/test_assertion.py::TestAssert_reprcompare.test_iterable_full_diff

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

652 ],
653 )
654 def test_iterable_full_diff(self, left, right, expected) -> None:
655 class="st">"""Test the full diff assertion failure explanation.
656
657 When verbose is False, then just a -v notice to get the diff is rendered,
658 when verbose is True, then ndiff of the pprint is returned.
659 class="st">"""
660 expl = callequal(left, right, verbose=0)
661 assert expl is not None
662 assert expl[-1] == class="st">"Use -v to get more diff"
663 verbose_expl = callequal(left, right, verbose=1)
664 assert verbose_expl is not None
665 assert class="st">"\n".join(verbose_expl).endswith(textwrap.dedent(expected).strip())
666
667 def test_iterable_quiet(self) -> None:
668 expl = callequal([1, 2], [10, 2], verbose=-1)

Callers

nothing calls this directly

Calls 4

callequalFunction · 0.85
endswithMethod · 0.80
joinMethod · 0.80
stripMethod · 0.80

Tested by

no test coverage detected