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

Method test_not_in_compare

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

Source from the content-addressed store, hash-verified

571 self.assertEqual(repr(c), 'TestCase.test_not_in_repr.<locals>.C(y=20)')
572
573 def test_not_in_compare(self):
574 @dataclass
575 class C:
576 x: int = 0
577 y: int = field(compare=False, default=4)
578
579 self.assertEqual(C(), C(0, 20))
580 self.assertEqual(C(1, 10), C(1, 20))
581 self.assertNotEqual(C(3), C(4, 10))
582 self.assertNotEqual(C(3, 10), C(4, 10))
583
584 def test_no_unhashable_default(self):
585 # See bpo-44674.

Callers

nothing calls this directly

Calls 3

assertEqualMethod · 0.95
assertNotEqualMethod · 0.95
CClass · 0.70

Tested by

no test coverage detected