Skip to content

Commit 4955d88

Browse files
author
Ana Falcao
committed
remove exceptions not needed
1 parent dd22d3f commit 4955d88

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

tests/functional/parser/test_parser.py

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -191,37 +191,6 @@ def handler(event, _):
191191
with pytest.raises(ValidationError):
192192
parse(event, model=Shopping)
193193

194-
class NonPydanticModel:
195-
pass
196-
197-
def test_event_parser_invalid_model_type():
198-
class NonPydanticModel:
199-
pass
200-
201-
class NonPydanticEnvelope:
202-
pass
203-
204-
event = {"id": 123, "breed": "Staffie", "bath": False}
205-
206-
@event_parser(model=NonPydanticModel)
207-
def handler(event, _):
208-
return event
209-
210-
# Test direct handler invocation
211-
with pytest.raises(exceptions.InvalidModelTypeError) as exc_info:
212-
handler(event, None)
213-
assert "unable to be validated" in str(exc_info.value)
214-
215-
# Test parse function with invalid model
216-
with pytest.raises(exceptions.InvalidModelTypeError) as exc_info:
217-
parse(event=event, model=NonPydanticModel)
218-
assert "unable to be validated" in str(exc_info.value)
219-
220-
# Test parse function with invalid envelope
221-
with pytest.raises(exceptions.InvalidEnvelopeError) as exc_info:
222-
parse(event=event, model=NonPydanticModel, envelope=NonPydanticEnvelope)
223-
assert "Error" in str(exc_info.value)
224-
225194

226195
@pytest.mark.parametrize(
227196
"test_input,expected",

0 commit comments

Comments
 (0)