diff options
Diffstat (limited to 'tests/test_invalid.py')
-rw-r--r-- | tests/test_invalid.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_invalid.py b/tests/test_invalid.py new file mode 100644 index 0000000..11aa1fd --- /dev/null +++ b/tests/test_invalid.py @@ -0,0 +1,16 @@ +from datetime import time, timezone + +import pytest + +import tomli_w + + +def test_invalid_type_nested(): + with pytest.raises(TypeError): + tomli_w.dumps({"bytearr": bytearray()}) + + +def test_invalid_time(): + offset_time = time(23, 59, 59, tzinfo=timezone.utc) + with pytest.raises(ValueError): + tomli_w.dumps({"offset time": offset_time}) |