Skip to content

Commit

Permalink
test: fix expected pydantic error msg
Browse files Browse the repository at this point in the history
  • Loading branch information
percevalw committed Jan 31, 2024
1 parent e364ffa commit 524c3bf
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/test_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,10 @@ def test(val: datetime.datetime):
" invalid datetime format, got 'hello' (str)"
)
else:
assert str(e.value) == (
"1 validation error for test_validate.test_dates.<locals>.test()\n"
"-> val\n"
" input should be a valid datetime, input is too short, got 'hello' (str)"
)
err = str(e.value)
assert "1 validation error for test_validate.test_dates.<locals>.test()" in err
assert "-> val" in err
assert "input is too short, got 'hello'" in err


def test_fail_init():
Expand Down

0 comments on commit 524c3bf

Please sign in to comment.