Skip to content

TypeError: _on_request() takes exactly 3 arguments (8 given) #138

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:

Activity

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

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions