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

Method test_combinations

tests/unit/test_constraints.py:511–522  ·  view source on GitHub ↗
(self, proto, meta, good, bad)

Source from the content-addressed store, hash-verified

509 ],
510 )
511 def test_combinations(self, proto, meta, good, bad):
512 class Ex(msgspec.Struct):
513 x: Annotated[str, meta]
514
515 dec = proto.Decoder(Ex)
516
517 for x in good:
518 assert dec.decode(proto.encode(Ex(x))).x == x
519
520 for x in bad:
521 with pytest.raises(msgspec.ValidationError):
522 dec.decode(proto.encode(Ex(x)))
523
524 @pytest.mark.parametrize(
525 "meta, good, bad",

Callers

nothing calls this directly

Calls 2

decodeMethod · 0.80
ExClass · 0.70

Tested by

no test coverage detected