-
Notifications
You must be signed in to change notification settings - Fork 84
tests: Add regex patterns to the expected JSON schema for test_json_schema #358
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
Merged
+34
−12
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…chema The test_json_schema function in tests/test_coordinate.py and tests/test_json_schema.py has been failing fails since the feature introduced in the pydantic/pydantic@4057cd2 commit. Signed-off-by: Alexandr Shashkin <[email protected]>
Contributor
Author
|
These changes are applied when using pydantic >= 2.12.0. |
yezz123
reviewed
Dec 23, 2025
Comment on lines
+221
to
+224
| 'anyOf': [ | ||
| {'maximum': 90.0, 'minimum': -90.0, 'type': 'number'}, | ||
| {'type': 'string','pattern': '^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$'} | ||
| ], |
Collaborator
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.
can you @dutyrok make a separated test specifying the python version
yezz123
added a commit
that referenced
this pull request
Dec 26, 2025
* Add mime_types.py (#348) * add mime_types.py * Revert formatting * Re-run formatting * Remove coverage check for StrEnums * Update the mime_types --------- Co-authored-by: Yasser Tahiri <[email protected]> * tests: Add regex patterns to the expected JSON schema for test_json_schema (#358) The test_json_schema function in tests/test_coordinate.py and tests/test_json_schema.py has been failing fails since the feature introduced in the pydantic/pydantic@4057cd2 commit. Signed-off-by: Alexandr Shashkin <[email protected]> * Update Python version requirements and classifiers in pyproject.toml and uv.lock - Updated the required Python version from 3.8 to 3.9 in both pyproject.toml and uv.lock. - Added support for Python 3.14 in the classifiers section of pyproject.toml. - Adjusted the target version for Ruff from 'py38' to 'py39'. - Cleaned up unnecessary resolution markers and dependencies in uv.lock. These changes ensure compatibility with newer Python versions and streamline dependency management. * Refactor type hints to use built-in tuple syntax and improve code consistency - Updated type hints in color.py, coordinate.py, and mime_types.py to use the built-in `tuple` syntax instead of `Tuple` from typing. - Adjusted the CronSeeker class in cron.py to include a proper method definition. - Cleaned up import statements in several files to remove unnecessary imports and ensure compatibility with Python 3.11. - Enhanced test cases in test_coordinate.py, test_json_schema.py, and test_mime_types.py for better readability and consistency. These changes improve code clarity and maintainability across the codebase. * Update CI configuration and Makefile for Python 3.14 support - Added support for Python 3.14 in the Makefile to run tests with the new version. - Updated the CI workflow to include Python 3.14 in the matrix of versions for testing. These changes ensure compatibility with the latest Python version and enhance the testing framework. * Enhance coordinate type handling and JSON schema generation - Introduced a new annotation for handling float and Decimal types in coordinates, ensuring proper JSON schema representation. - Updated the CoordinateType to utilize the new annotation for better serialization. - Added JSON schema methods to Latitude and Longitude classes to support decimal string validation. - Updated the uv.lock file to reflect changes in package versions and dependencies, including coverage and typing-extensions. These changes improve the handling of coordinate values and enhance the overall schema generation process. * Refactor cron.py and pendulum_dt.py for improved type handling and validation - Removed unnecessary type checking for CronSeeker in cron.py, simplifying the import structure. - Updated the schedule and next_after methods to directly return the expected types without casting. - Added validation in pendulum_dt.py to raise a ValueError for invalid ISO 8601 duration strings. These changes enhance code clarity and ensure proper type handling in the affected modules. * Update HISTORY.md for version 2.10.6 release - Added new features including credit card brand updates, time parsing for `pendulum`, and a new cron type. - Fixed various documentation issues and improved validation logic for `mac_address` and `phone_numbers`. - Enhanced test coverage for DomainStr validation and added usage examples for the `PhoneNumber` class. - Updated dependencies and fixed issues related to relative path creation on Windows. These changes enhance functionality, improve documentation, and ensure better validation across the codebase. --------- Signed-off-by: Alexandr Shashkin <[email protected]> Co-authored-by: Nitzan Bresler <[email protected]> Co-authored-by: Alexandr Shashkin <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The test_json_schema function in tests/test_coordinate.py and tests/test_json_schema.py has been failing fails since the feature introduced in the pydantic/pydantic@4057cd2 commit.