(self)
| 729 | assert x.__rich_repr__() == [] |
| 730 | |
| 731 | def test_repr_omit_defaults_one_field(self): |
| 732 | class Test(Struct, repr_omit_defaults=True): |
| 733 | a: int = 0 |
| 734 | |
| 735 | x = Test(0) |
| 736 | assert repr(x) == "Test()" |
| 737 | assert x.__rich_repr__() == [] |
| 738 | |
| 739 | x = Test(1) |
| 740 | assert repr(x) == "Test(a=1)" |
| 741 | assert x.__rich_repr__() == [("a", 1)] |
| 742 | |
| 743 | def test_repr_omit_defaults_multiple_fields(self): |
| 744 | class Test(Struct, repr_omit_defaults=True): |