-
-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add max error length #473
Add max error length #473
Conversation
return comps[0] | ||
|
||
def _format_error(error_description, bad_input, elipsis='[...]'): | ||
# there's three character more in the error, ie. ' ' x2 and a ':' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, a docstring would be nice, also linking to tje issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a docstring would be redundant and the issue's linked in the commit message.
Thanks! New version? |
Maybe let's merge #479 into master first? |
That might take a bit of time. Whenever you or I or anyone else feel like it, a new version can be generated. |
def test_error_message_doesnt_get_too_big(calendars, calendar_name): | ||
with pytest.raises(ValueError) as exception: | ||
calendars[calendar_name] | ||
assert len(str(exception).split(': ')[1]) <= 100 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That should probably be .split(': ', 1)
so a second ': '
does not hide later parts of the message from the assertion.
fix #472