MCPcopy Index your code
hub / github.com/python/cpython / test_init_kwargs

Method test_init_kwargs

Lib/test/test_reprlib.py:30–51  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

28class ReprTests(unittest.TestCase):
29
30 def test_init_kwargs(self):
31 example_kwargs = {
32 "maxlevel": 101,
33 "maxtuple": 102,
34 "maxlist": 103,
35 "maxarray": 104,
36 "maxdict": 105,
37 "maxset": 106,
38 "maxfrozenset": 107,
39 "maxdeque": 108,
40 "maxstring": 109,
41 "maxlong": 110,
42 "maxother": 111,
43 "fillvalue": "x" * 112,
44 "indent": "x" * 113,
45 }
46 r1 = Repr()
47 for attr, val in example_kwargs.items():
48 setattr(r1, attr, val)
49 r2 = Repr(**example_kwargs)
50 for attr in example_kwargs:
51 self.assertEqual(getattr(r1, attr), getattr(r2, attr), msg=attr)
52
53 def test_string(self):
54 eq = self.assertEqual

Callers

nothing calls this directly

Calls 3

ReprClass · 0.90
itemsMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected