test: mock the identity provider with httpware's transport= option - #3
Merged
Merged
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
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.
Problem
The tests, and the public
FakeIdentityProvider.create_jwks_client()helper injwks_client/testing.py, built anhttpx2.AsyncClientby hand only to inject aMockTransport, then wrapped it withhttpware.AsyncClient(httpx2_client=...). httpware does not close a client passed in that way, so those httpx2 clients were never closed.Change
httpware 0.18.0 forwards every httpx2 client option, so these sites now pass
transport=straight tohttpware.AsyncClient. httpware then owns the httpx2 client and closes it along with itself.jwks_client/testing.py,tests/conftest.py,tests/test_fastapi.py,tests/test_litestar.py:httpware.AsyncClient(transport=...)pyproject.toml: the httpware floor goes from 0.15.0 to 0.18.0.jwks_client.testingships in the package and needstransport=. The comment above the floor is updated to match.No behaviour change for library users other than the higher floor.
Verification
ruff, ty and the full suite pass locally (89 passed, 100% coverage) against httpware 0.18.0.