Skip to content

Respect false values for the validation error raise flag - #507

Open
xiehuanyi wants to merge 1 commit into
python-validators:masterfrom
xiehuanyi:fix-false-raise-validation-flag
Open

xiehuanyi wants to merge 1 commit into
python-validators:masterfrom
xiehuanyi:fix-false-raise-validation-flag

Conversation

@xiehuanyi

Copy link
Copy Markdown
Contributor

Passing r_ve=False currently enables raising because the decorator checks whether the keyword is present, rather than its value. This contradicts the documented switch and breaks callers that pass a boolean variable to choose between returned and raised validation errors.

Use the flag value while retaining the environment override. Tests exercise both a validator that returns false (slug) and one that raises while parsing (uuid), and verify that explicit true and RAISE_VALIDATION_ERROR=True continue to raise. Before the change, the two false-flag regressions fail. Afterwards the full suite passes: 1,177 tests and doctests, with complete Ruff lint/format, strict Pyright and Bandit checks also passing.

Copilot AI balanced review requested due to automatic review settings October 11, 2026 22:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

No deployments
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