(self)
| 1630 | assert gc.is_tracked(t) |
| 1631 | |
| 1632 | def test_force_setattr(self): |
| 1633 | class Ex(Struct, frozen=True): |
| 1634 | x: Any |
| 1635 | |
| 1636 | obj = Ex(1) |
| 1637 | |
| 1638 | res = msgspec.structs.force_setattr(obj, "x", 2) |
| 1639 | assert res is None |
| 1640 | assert obj.x == 2 |
| 1641 | |
| 1642 | with pytest.raises(AttributeError): |
| 1643 | msgspec.structs.force_setattr(obj, "oops", 3) |
| 1644 | |
| 1645 | with pytest.raises(TypeError): |
| 1646 | msgspec.structs.force_setattr(1, "oops", 3) |
| 1647 | |
| 1648 | |
| 1649 | class TestOrderAndEq: |