Closed hudson-ai closed 1 month ago
@riedgar-ms request for review
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 59.85%. Comparing base (
cb263a8
) to head (0273662
).
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
LGTM
This PR adds additional info to
ParserException
s to facilitate more explicit and stringent test conditions when a string is expected not to match a grammar.Changes to
_parser.py
:consumed_bytes
field toParserException
to communicate to the user which bytes were consumed before (and including) the failure.allowed_bytes
andconsumed_bytes
in theParserException
when applicableChanges to tests:
test_json.py
andtest_pydantic.py
(the only two test files that usedParserException
s to make asserts) to explicitly assert the expected values ofallowed_bytes
andconsumed_bytes
from the exception.tests/utils.py