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

Bug in pytest-httpx example #1691

Closed
simonw opened this issue Mar 26, 2022 · 0 comments
Closed

Bug in pytest-httpx example #1691

simonw opened this issue Mar 26, 2022 · 0 comments

Comments

@simonw
Copy link
Owner

simonw commented Mar 26, 2022

https://docs.datasette.io/en/0.61.1/testing_plugins.html#testing-outbound-http-calls-with-pytest-httpx says:

async def test_outbound_http_call(httpx_mock):
    httpx_mock.add_response(
        url='https://www.example.com/',
        data='Hello world',
    )

That's wrong - data= should be text=.

https://github.com/Colin-b/pytest_httpx/blob/v0.20.0/README.md#reply-with-custom-body

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

No branches or pull requests

1 participant