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

Method test_dataclasses_qualnames

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

Source from the content-addressed store, hash-verified

2213 self.assertEqual(sample.y, another_new_sample.y)
2214
2215 def test_dataclasses_qualnames(self):
2216 @dataclass(order=True, unsafe_hash=True, frozen=True)
2217 class A:
2218 x: int
2219 y: int
2220
2221 self.assertEqual(A.__init__.__name__, "__init__")
2222 for function in (
2223 '__eq__',
2224 '__lt__',
2225 '__le__',
2226 '__gt__',
2227 '__ge__',
2228 '__hash__',
2229 '__init__',
2230 '__repr__',
2231 '__setattr__',
2232 '__delattr__',
2233 ):
2234 self.assertEqual(getattr(A, function).__qualname__, f"TestCase.test_dataclasses_qualnames.<locals>.A.{function}")
2235
2236 with self.assertRaisesRegex(TypeError, r"A\.__init__\(\) missing"):
2237 A()
2238
2239
2240class TestFieldNoAnnotation(unittest.TestCase):

Callers

nothing calls this directly

Calls 3

assertEqualMethod · 0.95
assertRaisesRegexMethod · 0.95
AClass · 0.70

Tested by

no test coverage detected