Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: decouple test components from httpx #170

Merged
merged 4 commits into from
May 20, 2024
Merged

test: decouple test components from httpx #170

merged 4 commits into from
May 20, 2024

Conversation

chriso
Copy link
Contributor

@chriso chriso commented May 20, 2024

The test components we offer in the dispatch.test package were coupled to the httpx package, since this is what FastAPI uses internally (e.g. for its test client).

To be able to test other web frameworks (e.g. flask from #169), we need to decouple our test components from FastAPI and httpx.

This PR does just that, by using a protocol (i.e. structural typing) for the HTTP client and response.

I've downgraded httpx to a dev dependency as a result.

chriso added 4 commits May 21, 2024 08:55
We've moved away from the built-in test server
in favor of pushing users towards using the CLI.
The CLI sets environment variables, so there's
no chance of user error which is what these messages
were designed to help with.

Eliminating the httpx dependency means we can adapt
the test package to other web frameworks/clients.
@chriso chriso self-assigned this May 20, 2024
@chriso chriso merged commit fc85617 into main May 20, 2024
7 checks passed
@chriso chriso deleted the http-tests branch May 20, 2024 23:16
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