(self)
| 3696 | self.assertIs(a.__weakref__, a_ref) |
| 3697 | |
| 3698 | def test_slots_weakref_base_str(self): |
| 3699 | class Base: |
| 3700 | __slots__ = '__weakref__' |
| 3701 | |
| 3702 | @dataclass(slots=True) |
| 3703 | class A(Base): |
| 3704 | a: int |
| 3705 | |
| 3706 | # __weakref__ is in the base class, not A. But an A is still weakref-able. |
| 3707 | self.assertIn("__weakref__", Base.__slots__) |
| 3708 | self.assertNotIn("__weakref__", A.__slots__) |
| 3709 | a = A(1) |
| 3710 | weakref.ref(a) |
| 3711 | |
| 3712 | def test_slots_weakref_base_tuple(self): |
| 3713 | # Same as test_slots_weakref_base, but use a tuple instead of a string |
nothing calls this directly
no test coverage detected