-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Fix bug in IntegerValidator when an array contains both strings and integers, and add tests for IntegerValidator extras #4693
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
Conversation
@@ -56,6 +59,18 @@ def test_rejection_by_value(val, validator): | |||
def test_acceptance_min_max(val, validator_min_max): | |||
assert validator_min_max.validate_coerce(val) == approx(val) | |||
|
|||
# With extras | |||
@pytest.mark.parametrize("val", ['normal', 'bold']) |
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.
Thanks @marthacryan for the PR.
Could you please clarify which of these 3 cases we are testing here?
This is from https://github.com/plotly/plotly.py/pull/4612/files.
BTW I prefer to test all 3 cases.
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.
Done
packages/python/plotly/_plotly_utils/tests/validators/test_integer_validator.py
Outdated
Show resolved
Hide resolved
Please rename the title of the PR to indicate that this is a bug fix.
|
@archmoj Added! How does it look? |
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.
💃
Excellent.
Please merge it and then delete the branch.
Thank you!
Follow-up PR to #4612. Adds basic tests for passing and rejecting - also fixes a bug found while testing where the integer validator threw an error when arrays contained both strings and integers.
Code PR
plotly.graph_objects
, my modifications concern thecodegen
files and not generated files.modified existing tests.
- [ ] For a new feature, I have added documentation examples in an existing ornew tutorial notebook (please see the doc checklist as well).
- [ ] For a new feature or a change in behaviour, I have updated the relevant docstrings in the code to describe the feature or behaviour (please see the doc checklist as well).