Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.6k
✅ Useinline-snapshot
to support different Pydantic versions in the test suite#12534
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
ae68755
to8d1875b
Compare8d1875b
to9708ef1
Compareca3c891
to0bdd732
Compareinline-snapshot 0.15 is out. I changed the order of the v1,v2 arguments to match the order which is currently used in the tests. I changed not all the existing tests to use the new function. Let me know if you think this is needed. |
This is great! 🚀 I would love to have this in all the tests, but that's a giant task, you don't have to do it. 😅 Having this first one as a template is already great. 🚀 |
b430987
to2a7e93b
Compare…fferent pydantic versions
2a7e93b
tod8b34af
Compareinline-snapshot
to support different Pydantic versions in the test suiteinline-snapshot
to support different Pydantic versions in the test suitesnapshot_pydantic
to support different Pydantic versions in the test suitesnapshot_pydantic
to support different Pydantic versions in the test suiteinline-snapshot
to support different Pydantic versions in the test suiteThere 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.
This looks great, just left a few small suggestions & questions.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
@svlandeg, thank you for the review. I added the missing comment. |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
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.
This PR looks good to merge to me, but I'll run it internally by Tiangolo for a final review. Thanks again@15r10nk!
tiangolo left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
ea42ebd
intofastapi:masterUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
This pull-request contains an example how inline-snapshot can be used with different snapshots for different pydantic versions.
The following code can be used to create different snapshots for each pydantic version (pytest has to be run with both pydantic version).
both snapshots will be created (see example in the pull-request).
@tiangolo
I would be interested if this approach looks useful to you, or if you prefer the current IsDict(...)|IsDict(...) pattern for some reason.
The next version of inline-snapshot will support things like
snapshot_pydantic()
inside of snapshots. which will make the following code work:Thank you for using inline-snapshot 😃.