MCPcopy Index your code
hub / github.com/msgspec/msgspec / test_repr_two_fields

Method test_repr_two_fields

tests/unit/test_struct.py:714–721  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

712 assert x.__rich_repr__() == [("a", 1)]
713
714 def test_repr_two_fields(self):
715 class Test(Struct):
716 a: int
717 b: str
718
719 x = Test(1, "y")
720 assert repr(x) == "Test(a=1, b='y')"
721 assert x.__rich_repr__() == [("a", 1), ("b", "y")]
722
723 def test_repr_omit_defaults_empty(self):
724 class Test(Struct, repr_omit_defaults=True):

Callers

nothing calls this directly

Calls 1

TestClass · 0.70

Tested by

no test coverage detected