Test that StructMeta can be used directly as a metaclass.
()
| 20 | |
| 21 | |
| 22 | def test_struct_meta_direct_usage(): |
| 23 | """Test that StructMeta can be used directly as a metaclass.""" |
| 24 | |
| 25 | class CustomStruct(metaclass=StructMeta): |
| 26 | x: int |
| 27 | y: str |
| 28 | |
| 29 | # Verify the struct works as expected |
| 30 | instance = CustomStruct(x=1, y="test") |
| 31 | assert instance.x == 1 |
| 32 | assert instance.y == "test" |
| 33 | assert isinstance(instance, CustomStruct) |
| 34 | assert isinstance(CustomStruct, StructMeta) |
| 35 | |
| 36 | |
| 37 | def test_struct_meta_options(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…