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

Function test_struct_meta_with_struct_base

tests/unit/test_struct_meta.py:67–79  ·  view source on GitHub ↗

Test using StructMeta with Struct as a base class.

()

Source from the content-addressed store, hash-verified

65
66
67def test_struct_meta_with_struct_base():
68 """Test using StructMeta with Struct as a base class."""
69
70 class CustomStruct(Struct):
71 x: int
72 y: str
73
74 # Verify the struct works as expected
75 instance = CustomStruct(x=1, y="test")
76 assert instance.x == 1
77 assert instance.y == "test"
78 assert isinstance(instance, CustomStruct)
79 assert isinstance(CustomStruct, StructMeta)
80
81
82def test_struct_meta_validation():

Callers

nothing calls this directly

Calls 1

CustomStructClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…