Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions tests/test_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Loading