-
-
Notifications
You must be signed in to change notification settings - Fork 360
Closed
Description
The documentation states:
You can also add multiple responses for the same url: ....
However, this is not true if you interleave adding and requesting responses:
>>> import responses
>>> import requests
>>>
>>> responses.start()
>>>
>>> responses.add(responses.GET, "https://example.com/",
... json={'response': 'old'}
... )
>>> requests.get('https://example.com/').content
b'{"response": "old"}'
>>>
>>> responses.add(responses.GET, "https://example.com/",
... json={'response': 'new'}
... )
>>>
>>>
>>> requests.get('https://example.com/').content
b'{"response": "old"}'
>>> requests.get('https://example.com/').content
b'{"response": "new"}'
>>> requests.get('https://example.com/').content
b'{"response": "new"}'Expected result: After adding the "new" response, a "new" response is returned in the subsequent request.
Requests version: '2.19.1', Python 3.6.6
niksite, P6rguVyrst, pb-jeff-oneill and ramonvg
Metadata
Metadata
Assignees
Labels
No labels