Skip to content

test: build mock httpware clients with transport= instead of a borrowed httpx2 client - #86

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 provider tests built an httpx2.Client by hand only to inject a MockTransport, then wrapped it with httpware.Client(httpx2_client=...). httpware does not close a client passed in that way, so _make_provider in both provider test modules returned the inner httpx2 client separately for teardown, with a comment explaining the workaround. tests/conftest.py needed two fixtures for one client.

Change

httpware 0.18.0 forwards every httpx2 client option, so the mocks pass transport= straight to httpware.Client. httpware then owns the httpx2 client and closes it along with itself.

  • _make_provider (GitLab and GitHub) returns the httpware client. Call sites keep with client: unchanged, and the workaround comment is gone.
  • tests/conftest.py: gitlab_client and gitlab_http merge into a single gitlab_http fixture.
  • tests/integration/conftest.py: install_mock_transport builds the client in one call.
  • tests/integration/README.md: describes the new construction.
  • pyproject.toml: the httpware floor goes from 0.15.0 to 0.18.0, because the tests need transport= and the declared floor is what they run against.

The runtime code in semvertag/ioc.py is unchanged.

Verification

ruff, ty and the full suite pass locally (473 passed, 100% coverage) against httpware 0.18.0.

@lesnik512
lesnik512 merged commit a3b0049 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