Releases: getsentry/responses
Releases · getsentry/responses
0.23.3
- Allow urllib3>=1.25.10
0.23.2
This release is the last to support Python 3.7
- Updated dependency to urllib3>=2 and requests>=2.30.0. See #635
- Fixed issue when custom adapters were sending only positional args. See #642
- Expose
unbound_on_sendmethod inRequestsMockclass. This method returns new function
that is called byRequestsMockinstead of originalsendmethod defined by any adapter.
0.23.1
0.23.0
- Add Python 3.11 support
- Fix type annotations of
CallList. See #593 requestobject is attached to any custom exception provided asResponsebodyargument. See #588- Fixed mocked responses leaking between tests when
assert_all_requests_are_firedand a request was not fired. - [BETA] Default recorder format was changed to YAML. Added
responses.RequestsMock._parse_response_fileand
responses._recorder.Recorder.dump_to_filemethods that allow users to override default parser to eg toml, json
0.22.0
- Update
requestsdependency to the version of 2.22.0 or higher. See #584. - [BETA] Added possibility to record responses to TOML files via
@_recorder.record(file_path="out.toml")decorator. - [BETA] Added possibility to replay responses (populate registry) from TOML files
viaresponses._add_from_file(file_path="out.toml")method. - Fix type for the
mock's patcher object. See #556 - Fix type annotation for
CallList - Add
passthroughargument toBaseResponseobject. See #557 - Fix
registriesleak. See #563 OriginalResponseShimis removed. See #585- Add support for the
looseversion ofjson_params_matchervia named argumentstrict_match. See #551 - Add lists support as JSON objects in
json_params_matcher. See #559 - Added project links to pypi listing.
delete,get,head,options,patch,post,putshortcuts are now implemented usingfunctools.partialmethod.- Fix
MaxRetryErrorexception. Replace exception byRetryErroraccording torequestsimplementation. See #572. - Adjust error message when
Retryis exhausted. See #580.
0.21.0
- Add
threading.Lock()to allowresponsesworking withthreadingmodule. - Add
urllib3Retrymechanism. See #135 - Removed internal
_cookies_from_headersfunction - Now
add,upsert,replacemethods return registered response.
removemethod returns list of removed responses. - Added null value support in
urlencoded_params_matcherviaallow_blankkeyword argument - Added strict version of decorator. Now you can apply
@responses.activate(assert_all_requests_are_fired=True)
to your function to validate that all requests were executed in the wrapped function. See #183
0.20.0
- Deprecate
responses.assert_all_requests_are_fired,responses.passthru_prefixes,responses.target
since they are not actual properties of the class instance.
Useresponses.mock.assert_all_requests_are_fired,
responses.mock.passthru_prefixes,responses.mock.targetinstead. - Fixed the issue when
reset()method was called in not stopped mock. See #511
0.19.0
- 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.activatedecorator 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 ofRequestsMockobject. Replaces internal_get_registry(). query_param_matchercan now accept dictionaries withintandfloatvalues.- Add support for the
looseversion ofquery_param_matchervia named argumentstrict_match. - Added support for
async/awaitfunctions. response_callbackis no longer executed on exceptions raised by failedResponses- Change logic of
_get_url_and_pathto 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_typeandheaders[content-type]are provided as parameters. - When a request isn't matched the passthru prefixes are now included in error messages.
0.18.0
- Dropped support of Python 2.7, 3.5, 3.6
- Fixed issue with type annotation for
responses.activatedecorator. See #468 - Removed internal
_is_stringand_ensure_strfunctions - Removed internal
_quotefromtest_responses.py - Removed internal
_matchesattribute ofRequestsMockobject. - Generated decorator wrapper now uses stdlib features instead of strings and exec
- Fix issue when Deprecation Warning was raised with default arguments
inresponses.add_callbackdue tomatch_querystring. See #464
0.17.0
- This release is the last to support Python 2.7.
- Fixed issue when
response.iter_contentwhenchunk_size=Noneentered infinite loop - Fixed issue when
passthru_prefixespersisted across tests.
Nowadd_passthruis valid only within a context manager or for a single function and
cleared on exit - Deprecate
match_querystringargument inResponse`` andCallbackResponse. Useresponses.matchers.query_param_matcherorresponses.matchers.query_string_matcher` - Added support for non-UTF-8 bytes in
responses.matchers.multipart_matcher - Added
responses.registries. Now user can create custom registries to
manipulate the order of responses in the match algorithm
responses.activate(registry=CustomRegistry) - Fixed issue with response match when requests were performed between adding responses with
same URL. See Issue #212