(strict)
| 155 | |
| 156 | @pytest.mark.parametrize("strict", [True, False]) |
| 157 | def 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 | |
| 169 | def test_decode_dec_hook(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…