diff --git a/tests/test_errors.py b/tests/test_errors.py index ec3df30..be29aed 100644 --- a/tests/test_errors.py +++ b/tests/test_errors.py @@ -36,6 +36,16 @@ def test_node_type_error_inherits_patch_error_and_type_error(self): assert issubclass(NodeTypeError, PatchError) assert issubclass(NodeTypeError, TypeError) + def test_node_type_error_catchable_as_patch_error(self): + msg = "not a list" + with pytest.raises(PatchError): + raise NodeTypeError(msg) + + def test_node_type_error_catchable_as_type_error(self): + msg = "not a list" + with pytest.raises(TypeError): + raise NodeTypeError(msg) + def test_raise_and_catch_base(self): msg = "key already exists" with pytest.raises(YAMLTripError, match=msg):