File: coercion.py

package info (click to toggle)
python-apischema 0.18.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,608 kB
  • sloc: python: 15,266; sh: 7; makefile: 7
file content (7 lines) | stat: -rw-r--r-- 176 bytes parent folder | download
1
2
3
4
5
6
7
import pytest

from apischema import ValidationError, deserialize

with pytest.raises(ValidationError):
    deserialize(bool, "ok")
assert deserialize(bool, "ok", coerce=True)