Skip to content

✅ Refactor OpenAPI tests, prepare for Pydantic v2#9503

Merged
tiangolo merged 4 commits intomasterfrom
refactor-openapi-tests
May 8, 2023
Merged

✅ Refactor OpenAPI tests, prepare for Pydantic v2#9503
tiangolo merged 4 commits intomasterfrom
refactor-openapi-tests

Conversation

@tiangolo
Copy link
Member

@tiangolo tiangolo commented May 8, 2023

✅ Refactor OpenAPI tests, prepare for Pydantic v2

During the migration, it will be very useful to check the tests with insert_assert from https://github.com/samuelcolvin/python-devtools

This prepares the code for that.


Before this change, there was normally a variable with openapi_schema, containing all the OpenAPI schema for each app tested. Then that was checked in a test for that.

But this doesn't allow easily inlining the result with insert_assert. By moving that schema to inside of the test, I'll be able to explore with insert_assert and verify in the diff what is wrong (later during the migration to Pydantic v2).

This needed to be done here, before that, because it only moves code/data around. But the diff is gigantic, so it shouldn't be mixed with code changing actual logic.

I also wanted to do it, to be able to keep using insert_assert, but that needed many consecutive hours of work, and a reason to go through all that work. But now this is a good reason to do it. 🤓

@github-actions
Copy link
Contributor

github-actions bot commented May 8, 2023

@github-actions github-actions bot temporarily deployed to pull request May 8, 2023 20:33 Inactive
@github-actions github-actions bot temporarily deployed to pull request May 8, 2023 20:38 Inactive
@tiangolo tiangolo marked this pull request as ready for review May 8, 2023 20:39
@github-actions
Copy link
Contributor

github-actions bot commented May 8, 2023

@github-actions github-actions bot temporarily deployed to pull request May 8, 2023 21:02 Inactive
@tiangolo tiangolo merged commit 50c1a92 into master May 8, 2023
@tiangolo tiangolo deleted the refactor-openapi-tests branch May 8, 2023 21:07
@GITHub8803
Copy link

GITHub8803 commented May 9, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants