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
fix: remove hardcoded version in pydantic>=2 tests #3255
base: main
Are you sure you want to change the base?
fix: remove hardcoded version in pydantic>=2 tests #3255
Conversation
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.
Great catch! Thank you so much 😊
CodSpeed Performance ReportMerging #3255 will not alter performanceComparing Summary
|
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #3255 +/- ##
==========================================
+ Coverage 96.36% 96.60% +0.24%
==========================================
Files 482 482
Lines 29952 29954 +2
Branches 3690 3694 +4
==========================================
+ Hits 28863 28937 +74
+ Misses 898 833 -65
+ Partials 191 184 -7 |
Ah looks like pydantic.version.version_short doesn't exist in pydantic 2
|
Sorry, I don't think it is a good idea to do - assert result.errors[0].message == (
+ assert (
"1 validation error for User\n"
"name\n"
" String should have at least 2 characters [type=string_too_short, "
"input_value='P', input_type=str]\n"
" For further information visit "
- f"https://errors.pydantic.dev/{pydantic.version.version_short()}/v/string_too_short"
- )
+ ) in result.errors[0].message |
@natsukium partial match is totally fine with me 😊 but since version_short seems to working in v1 maybe we can force pydantic to be at least 2.2 in the tests? what do you think? |
That's great. |
Let’s do >= in the nox file too
…On Sun, 26 Nov 2023 at 04:52, OTABI Tomoya ***@***.***> wrote:
That's great.
I did a quick check and it seems that pydantic>=2.2 is fine. Do I edit the
noxfile with pydantic~=2.2.0?
—
Reply to this email directly, view it on GitHub
<#3255 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFC3FIPHSEJDEE6POW2ZK3YGK4JFAVCNFSM6AAAAAA7Z2PVMSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRWGQ4DCNRYHA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Description
When I run the test with pydantic>=2 (pydantic!=2.0.3), two tests fail due to the hardcoded version.
This problem has not been found because no tests are currently run against pydantic2.
Error Log
Types of Changes
Issues Fixed or Closed by This PR
Checklist
I don't think RELEASE.md is necessary since this is a fix for internal test.