All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Added
respx.route(...)with enhanced request pattern matching. (PR #96) - Added support for AND/OR when request pattern matching. (PR #96)
- Added support for adding responses to a route using % operator. (PR #96)
- Added support for both
httpx.ResponseandMockResponse. (PR #96) - Enhanced Route (RequestPattern) with
.respond(...)response details. (PR #96) - Enhanced Route (RequestPattern) with
.pass_through(). (PR #96) - Introduced Route
.side_effect(...)in favour of callbacks. (PR #97) - Add support for using route as side effect decorator. (PR #98)
- Add headers and cookies patterns. (PR #99)
- Add contains and in lookups. (PR #99)
- Deprecated mixing of request pattern and response details in all API's. (PR #96)
- Deprecated passing http method as arg in
respx.addin favour ofmethod=. (PR #96) - Deprecated
alias=...in favour ofname=...when adding routes. (PR #96) - Deprecated
respx.aliasesin favour ofrespx.routes. (PR #96) - Deprecated
RequestPatternin favour ofRoute. (PR #96) - Deprecated
ResponseTemplatein favour ofMockResponse. (PR #96) - Deprecated
pass_through=in favour of.pass_through()(PR #96) - Deprecated
responsearg in side effects (callbacks). (PR #97) - Stacked responses are now recorded on same route calls. (PR #96)
- Pass-through routes no longer capture real response in call stats. (PR #97)
- Dropped support for
asyncside effects (callbacks). (PR #97) - Dropped support for mixing side effect (callback) and response details. (PR #97)
- Added
text,htmlandjsoncontent shorthands to ResponseTemplate. (PR #82) - Added
text,htmlandjsoncontent shorthands to high level API. (PR #93) - Added support to set
http_versionfor a mocked response. (PR #82) - Added support for mocking by lowercase http methods, thanks @lbillinghamtn. (PR #80)
- Added query
paramsto align with HTTPX API, thanks @jocke-l. (PR #81) - Easier API to get request/response from call stats, thanks @SlavaSkvortsov. (PR #85)
- Enhanced test to verify better content encoding by HTTPX. (PR #78)
- Added Python 3.9 to supported versions and test suite, thanks @jairhenrique. (PR #89)
ResponseTemplate.contentas proper getter, i.e. no resolve/encode to bytes. (PR #82)- Enhanced headers by using HTTPX Response when encoding raw responses. (PR #82)
- Deprecated
respx.statsin favour ofrespx.calls, thanks @SlavaSkvortsov. (PR #92)
- Recorded requests in call stats are pre-read like the responses. (PR #86)
- Postponed request decoding for enhanced performance. (PR #91)
- Lazy call history for enhanced performance, thanks @SlavaSkvortsov. (PR #92)
- Removed auto setting the
Content-Type: text/plainheader. (PR #82)
- Fixed support for
HTTPX0.15. (PR #77)
- Added global
respx.popapi, thanks @paulineribeyre. (PR #72)
- Dropped deprecated
HTTPXMockin favour ofMockTransport. - Dropped deprecated
respx.requestin favour ofrespx.add. - Removed
HTTPXmax version requirement in setup.py.
- Fixed non-iterable pass-through responses. (PR #68)
- Dropped no longer needed
asynctestdependency, in favour of built-in mock. (PR #69)
- Fixed support for
HTTPX0.14.0. (PR #45)
- Added support for pop'ing a request pattern by alias, thanks @radeklat. (PR #60)
- Fixed mocking
HTTPXclients instantiated with proxies. (PR #58) - Fixed matching URL patterns with missing path. (PR #59)
- Fixed support for
HTTPX0.13. (PR #57)
- Added support for mocking out
HTTP Core. - Added support for using mock transports with
HTTPXclients without patching. - Include LICENSE.md in source distribution, thanks @synapticarbors.
- Renamed passed mock to decorated functions from
httpx_mocktorespx_mock. - Renamed
HTTPXMocktoMockTransport, but kept a deprecatedHTTPXMocksubclass. - Deprecated
respx.request()in favour ofrespx.add().
- Fixed support for
HTTPX0.12.0. (PR #45)
- Refactored high level and internal api for better editor autocompletion. (PR #44)
- Fixed usage of nested or parallel mock instances. (PR #39)
- Fixed support for
HTTPX0.11.0 sync api. (PR #38)
- Renamed refactored httpx internals. (PR #37)
- Added support for configuring patterns
base_url. (PR #34) - Added manifest and
py.typedfiles.
- Fixed support for
HTTPX0.9.3 refactorizations. (PR #35)
- Added documentation built with
mkdocs. (PR #30)
- Dropped sync support and now requires
HTTPXversion 0.8+. (PR #32) - Renamed
respx.mockmodule torespx.api. (PR #29) - Refactored tests- and checks-runner to
nox. (PR #31)
- Allowing assertions to be configured through decorator and context manager. (PR #28)
- Allows
mockdecorator to be used as sync or async context manager. (PR #27)
- Added
statsto high level API and patterns, along withcall_count. (PR #25)
- Allowing headers to be modified within a pattern match callback. (PR #26)
- Fixed responses in call stats when using synchronous
HTTPXclient. (PR #23)
- Added support for
pass_throughpatterns. (PR #20) - Added
assert_all_mockedfeature and setting. (PR #21)
- Requires all
HTTPXrequests to be mocked.
- Renamed
activatedecorator tomock. (PR #15)
- Added
assert_all_calledfeature and setting. (PR #14)
- Clears call stats when exiting decorator.
- Renamed python package to
respx. (PR #12) - Renamed
add()torequest()and added HTTP method shorthands. (PR #13)
- Renamed PyPI package to
respx.
- Exposes
responsexhigh level API along with aactivatedecorator. (PR #5) - Added support for custom pattern match callback function. (PR #7)
- Added support for repeated patterns. (PR #8)
- Added support for any
HTTPXconcurrency backend.
- Initial POC.