-
Notifications
You must be signed in to change notification settings - Fork 264
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
Use core schema fns to initalize SchemaValidator
s in the test suite.
#1631
Use core schema fns to initalize SchemaValidator
s in the test suite.
#1631
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1631 +/- ##
==========================================
- Coverage 90.21% 89.58% -0.63%
==========================================
Files 106 115 +9
Lines 16339 17905 +1566
Branches 36 25 -11
==========================================
+ Hits 14740 16040 +1300
- Misses 1592 1846 +254
- Partials 7 19 +12 see 66 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
CodSpeed Performance ReportMerging #1631 will not alter performanceComparing Summary
|
37d4e29
to
3fa5d10
Compare
To track which Validatorstests/test_misc.py
tests/test_build.py
tests/test_json.py
tests/test_validate_strings.py
tests/validators/test_arguments.py
tests/validators/test_union.py
tests/validators/test_definitions_recursive.py
tests/validators/test_with_default.py
tests/validators/test_pickling.py
tests/validators/test_list.py
tests/validators/test_allow_partial.py
tests/validators/test_nullable.py
tests/validators/test_typed_dict.py
tests/validators/test_model_init.py
tests/validators/test_function.py
tests/validators/test_is_instance.py
tests/validators/test_tuple.py
tests/validators/test_model_fields.py
tests/validators/test_json.py
tests/validators/test_uuid.py
tests/validators/test_model.py
tests/validators/test_dataclasses.py
tests/validators/test_json_or_python.py
tests/benchmarks/test_serialization_micro.py
tests/benchmarks/test_micro_benchmarks.py
tests/benchmarks/nested_schema.py
tests/serializers/test_other.py
tests/serializers/test_any.py
tests/serializers/test_serialize_as_any.py
tests/serializers/test_model.py
tests/serializers/test_dataclasses.py
|
please review :) |
SchemaValidator
s in the test suite.
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.
A massive effort, thanks. Looks overall great, we should get this merged swiftly and without too much more changes lest it get unreviewable or too many merge conflicts.
Just one small set of questions I want to understand before merging...
tests/validators/test_dataclasses.py
Outdated
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.
Changes in this file look like they have removed cases unintentionally, perhaps revert this file?
@@ -1655,15 +1603,15 @@ def test_frozen_field(): | |||
'config,schema_extra_behavior_kw', | |||
[ | |||
(core_schema.CoreConfig(extra_fields_behavior='allow'), {}), | |||
(core_schema.CoreConfig(extra_fields_behavior='allow'), {'extra_behavior': None}), | |||
(core_schema.CoreConfig(extra_fields_behavior='allow'), {}), |
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.
Similar changes here and below?
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! found a few more cases as well! thank you!
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, LGTM!
Change Summary
Changes the initialization of most of the
SchemaValidator
s in the test suite to usecore_schema.xxx_schema()
functions instead of dicts, as proposed in #831, and explicitly calls the associatedCoreConfig
typed dicts for the config.Related issue number
#831
Checklist
pydantic-core
(except for expected changes)Selected Reviewer: @sydney-runkle