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

Function test_decode_strict_or_lax

tests/unit/test_yaml.py:157–166  ·  view source on GitHub ↗
(strict)

Source from the content-addressed store, hash-verified

155
156@pytest.mark.parametrize("strict", [True, False])
157def test_decode_strict_or_lax(strict):
158 msg = b"a: ['1', '2']"
159 typ = Dict[str, List[int]]
160
161 if strict:
162 with pytest.raises(msgspec.ValidationError, match="Expected `int`"):
163 msgspec.yaml.decode(msg, type=typ, strict=strict)
164 else:
165 res = msgspec.yaml.decode(msg, type=typ, strict=strict)
166 assert res == {"a": [1, 2]}
167
168
169def test_decode_dec_hook():

Callers

nothing calls this directly

Calls 1

decodeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…