MCPcopy Create free account
hub / github.com/msgspec/msgspec / test_struct_meta_options

Function test_struct_meta_options

tests/unit/test_struct_meta.py:37–46  ·  view source on GitHub ↗

Test that StructMeta properly handles struct options.

()

Source from the content-addressed store, hash-verified

35
36
37def test_struct_meta_options():
38 """Test that StructMeta properly handles struct options."""
39
40 class CustomStruct(metaclass=StructMeta, frozen=True):
41 x: int
42
43 # Verify options were applied
44 instance = CustomStruct(x=1)
45 with pytest.raises(AttributeError):
46 instance.x = 2 # Should be frozen
47
48
49def test_struct_meta_field_processing():

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…