Skip to content

Releases: getsentry/responses

Responses 0.25.1

16 May 14:07
Compare
Choose a tag to compare

What's Changed

  • Use pytest.mark.asyncio by @markstory in #707
  • fix mocked HEAD response when content-length header is present by @ddarricau in #712
  • fix(matchers): Don't sort failed matches when printing error message by @mgaligniana in #711

New Contributors

Full Changelog: 0.25.0...0.25.1

0.25.0

13 Feb 21:15
Compare
Choose a tag to compare
  • Added support for Python 3.12
  • Fixed matchers.header_matcher not failing when a matched header is missing from the request. See #702

0.24.1

14 Nov 22:56
Compare
Choose a tag to compare
  • Reverted overloads removal
  • Added typing to Call attributes.
  • Fix socket issues (see #693)

0.24.0

03 Nov 13:52
Compare
Choose a tag to compare
  • Added BaseResponse.calls to access calls data of a separate mocked request. See #664
  • Added real_adapter_send parameter to RequestsMock that will allow users to set
    through which function they would like to send real requests
  • Added support for re.Pattern based header matching.
  • Added support for gzipped response bodies to json_params_matcher.
  • Fix Content-Type headers issue when the header was duplicated. See #644
  • Moved types-pyyaml dependency to tests_requires
  • Removed Python3.7 support

0.23.3

01 Aug 14:19
Compare
Choose a tag to compare
  • Allow urllib3>=1.25.10

0.23.2

25 Jul 16:41
Compare
Choose a tag to compare

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_send method in RequestsMock class. This method returns new function
    that is called by RequestsMock instead of original send method defined by any adapter.

0.23.1

10 Mar 21:27
Compare
Choose a tag to compare
  • Remove tomli import. See #630

0.23.0

10 Mar 16:47
Compare
Choose a tag to compare
  • Add Python 3.11 support
  • Fix type annotations of CallList. See #593
  • request object is attached to any custom exception provided as Response body argument. See #588
  • Fixed mocked responses leaking between tests when assert_all_requests_are_fired and a request was not fired.
  • [BETA] Default recorder format was changed to YAML. Added responses.RequestsMock._parse_response_file and
    responses._recorder.Recorder.dump_to_file methods that allow users to override default parser to eg toml, json

0.22.0

11 Oct 16:34
Compare
Choose a tag to compare
  • Update requests dependency 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
    via responses._add_from_file(file_path="out.toml") method.
  • Fix type for the mock's patcher object. See #556
  • Fix type annotation for CallList
  • Add passthrough argument to BaseResponse object. See #557
  • Fix registries leak. See #563
  • OriginalResponseShim is removed. See #585
  • Add support for the loose version of json_params_matcher via named argument strict_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, put shortcuts are now implemented using functools.partialmethod.
  • Fix MaxRetryError exception. Replace exception by RetryError according to requests implementation. See #572.
  • Adjust error message when Retry is exhausted. See #580.

0.21.0

25 May 14:20
Compare
Choose a tag to compare
  • Add threading.Lock() to allow responses working with threading module.
  • Add urllib3 Retry mechanism. See #135
  • Removed internal _cookies_from_headers function
  • Now add, upsert, replace methods return registered response.
    remove method returns list of removed responses.
  • Added null value support in urlencoded_params_matcher via allow_blank keyword 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