Closed
Description
I use responses
while testing a few calls to a REST API. Calls to the REST API are made using requests.HTTPAdapter.send()
(https://github.com/kennethreitz/requests/blob/master/requests/adapters.py#L375)
Mocking these requests with responses
fails (at least when I have not prepared responses) with the following error message:
adapter = <requests.HTTPAdapter object at 0x105a8b890>
request = <PreparedRequest [GET]>, a = (False, None, True, None, None)
kwargs = {}
def unbound_on_send(adapter, request, *a, **kwargs):
> return self._on_request(adapter, request, *a, **kwargs)
E TypeError: _on_request() takes exactly 3 arguments (8 given)
unbound_on_send
is located in responses
. The values for parameter a
are the (default) parameters passed to HTTPAdapter.send()
.
These are the relevant lines in responses
:
- https://github.com/getsentry/responses/blob/master/responses.py#L297 (call with expanded arguments)
- https://github.com/getsentry/responses/blob/master/responses.py#L231 (callee does not support extra positional arguments)
Metadata
Assignees
Labels
No labels
Activity