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

Method test_dict_wrap

testing/test_assertion.py:551–584  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

549 ]
550
551 def test_dict_wrap(self) -> None:
552 d1 = {"common": 1, "env": {"env1": 1, "env2": 2}}
553 d2 = {"common": 1, "env": {"env1": 1}}
554
555 diff = callequal(d1, d2, verbose=True)
556 assert diff == [
557 "{'common': 1,...1, 'env2': 2}} == {'common': 1,...: {'env1': 1}}",
558 "Omitting 1 identical items, use -vv to show",
559 "Differing items:",
560 "{'env': {'env1': 1, 'env2': 2}} != {'env': {'env1': 1}}",
561 "Full diff:",
562 "- {'common': 1, 'env': {'env1': 1}}",
563 "+ {'common': 1, 'env': {'env1': 1, 'env2': 2}}",
564 "? +++++++++++",
565 ]
566
567 long_a = "a" * 80
568 sub = {"long_a": long_a, "sub1": {"long_a": "substring that gets wrapped " * 2}}
569 d1 = {"env": {"sub": sub}}
570 d2 = {"env": {"sub": sub}, "new": 1}
571 diff = callequal(d1, d2, verbose=True)
572 assert diff == [
573 "{'env': {'sub... wrapped '}}}} == {'env': {'sub...}}}, 'new': 1}",
574 "Omitting 1 identical items, use -vv to show",
575 "Right contains 1 more item:",
576 "{'new': 1}",
577 "Full diff:",
578 " {",
579 " 'env': {'sub': {'long_a': '" + long_a + "',",
580 " 'sub1': {'long_a': 'substring that gets wrapped substring '",
581 " 'that gets wrapped '}}},",
582 "- 'new': 1,",
583 " }",
584 ]
585
586 def test_dict(self) -> None:
587 expl = callequal({"a": 0}, {"a": 1})

Callers

nothing calls this directly

Calls 1

callequalFunction · 0.85

Tested by

no test coverage detected