- Added a registry that provides more strict ordering based on the invocation index.
Seeresponses.registries.OrderedRegistry
. - Added shortcuts for each request method: delete, get, head, options, patch, post, put.
For example, to add response for POST request you can useresponses.post()
instead
ofresponses.add(responses.POST)
. - Prevent
responses.activate
decorator to leak, if wrapped function called from within another
wrapped function. Also, allow calling of above mentioned chain. See #481 for more details. - Expose
get_registry()
method ofRequestsMock
object. Replaces internal_get_registry()
. query_param_matcher
can now accept dictionaries withint
andfloat
values.- Add support for the
loose
version ofquery_param_matcher
via named argumentstrict_match
. - Added support for
async/await
functions. response_callback
is no longer executed on exceptions raised by failedResponse
s- Change logic of
_get_url_and_path
to comply with RFC 3986. Now URL match occurs by matching
schema, authority and path, where path is terminated by the first question mark ("?") or
number sign ("#") character, or by the end of the URI. - An error is now raised when both
content_type
andheaders[content-type]
are provided as parameters. - When a request isn't matched the passthru prefixes are now included in error messages.