Responses

Latest version: v0.25.3

Safety actively analyzes 682441 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 9

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_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

------

* Remove `tomli` import. See 630

0.23.0

------

* 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

------

* 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

------

* 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

Page 2 of 9

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.