diff --git a/tests/schemas/test_stubs.py b/tests/schemas/test_stubs.py index 5b0c61c..7c729e6 100644 --- a/tests/schemas/test_stubs.py +++ b/tests/schemas/test_stubs.py @@ -95,9 +95,22 @@ class TestAddressBookStub: assert ab.people is not None -# dummy.capnp runtime tests skipped — its annotation imports (c.capnp, -# c++.capnp) cause pycapnp's C++ SchemaParser to SIGABRT. The generated -# .pyi passes static type-checking and `capnp compile -opy` succeeds. +class TestDummyStub: + """dummy.capnp — comprehensive test schema.""" + + def test_all_types_loads(self) -> None: + from pathlib import Path + parser = capnp.SchemaParser() # pyright: ignore[reportAttributeAccessIssue] + m = parser.load(str(Path(__file__).parent / "dummy.capnp")) + msg = m.TestAllTypes.new_message(textField="hello", int32Field=42) + assert msg.textField == "hello" + + def test_unions(self) -> None: + from pathlib import Path + parser = capnp.SchemaParser() # pyright: ignore[reportAttributeAccessIssue] + m = parser.load(str(Path(__file__).parent / "dummy.capnp")) + u = m.TestUnion.new_message() + assert u is not None # Note: multi/consumer.capnp cross-file import test skipped —