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

Method test_lookup_on_class

Lib/test/test_dataclasses/__init__.py:4066–4077  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4064 self.assertEqual(d.__set_name__.call_count, 0)
4065
4066 def test_lookup_on_class(self):
4067 # See bpo-33175.
4068 class D:
4069 pass
4070 D.__set_name__ = Mock()
4071
4072 # Make sure D.__set_name__ is called.
4073 @dataclass
4074 class C:
4075 i: int=field(default=D(), init=False)
4076
4077 self.assertEqual(D.__set_name__.call_count, 1)
4078
4079 def test_init_calls_set(self):
4080 class D:

Callers

nothing calls this directly

Calls 2

MockClass · 0.90
assertEqualMethod · 0.45

Tested by

no test coverage detected