Skip to content

Conversation

@manyamittal25
Copy link
Contributor

This PR adds comprehensive tests for the humanize.py module to improve test coverage from 71% to 100%.

Changes

  • Add tests for _nested_getitem error handling (KeyError, IndexError, TypeError)
  • Add tests for humanize_error with long error message truncation
  • Add tests for validate_with_humanized_errors success and failure cases
  • Add tests for edge cases with None data and multiple validation errors
  • Improve overall test coverage from 89% to 90%

Coverage Improvement

  • humanize.py: 71% → 100% coverage
  • Overall project: 89% → 90% coverage
  • All 162 tests passing (no regressions)

Testing

  • Added 10 new test functions
  • All tests pass locally
  • Code formatted with black
  • Addresses missing coverage in humanize.py lines 19-22, 45, and 54-57

…om 71% to 100%

- Add tests for _nested_getitem error handling (KeyError, IndexError, TypeError)
- Add tests for humanize_error with long error message truncation
- Add tests for validate_with_humanized_errors success and failure cases
- Add tests for edge cases with None data and multiple validation errors
- Improve overall test coverage from 89% to 90%

This addresses the missing coverage in humanize.py lines 19-22, 45, and 54-57.
@alecthomas alecthomas merged commit 86bcb03 into alecthomas:master Aug 2, 2025
7 of 8 checks passed
@alecthomas
Copy link
Owner

Thanks! Looks like the import order was pre-existing issue, don't worry about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants