Skip to content

test: mock the identity provider with httpware's transport= option - #3

Merged
lesnik512 merged 1 commit into
mainfrom
test/mock-via-transport
Oct 1, 2026
Merged

lesnik512 merged 1 commit into
mainfrom
test/mock-via-transport

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Problem

The tests, and the public FakeIdentityProvider.create_jwks_client() helper in jwks_client/testing.py, built an httpx2.AsyncClient by hand only to inject a MockTransport, then wrapped it with httpware.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 to httpware.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.testing ships in the package and needs transport=. 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.

@lesnik512
lesnik512 merged commit 0f24861 into main Oct 1, 2026
14 checks passed
@lesnik512
lesnik512 deleted the test/mock-via-transport branch October 1, 2026 12:14
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.

1 participant