Releases: h2non/pook
v2.1.4
Apologies to all for the delayed release. Overwhelming work and various other personal issues (including a broken hand) has made it difficult to find the time. I will have some free time coming up where I'll look into ways of making the release process as easy as possible so this kind of delay doesn't happen again in the future.
What's Changed
- Replace pytest-httpbin with minimal Falcon version by @sarayourfriend in #160
- Fix type of aiohttp raw headers by @rsmeral in #161
- Fix aiohttp tuple parameters handling by @toxinu in #162
New Contributors
Full Changelog: v2.1.3...v2.1.4
v2.1.3
Available on PyPI: https://pypi.org/project/pook/2.1.3/
What's Changed
- Ensure aiohttp headers matchable from both session and request by @sarayourfriend in #158
Full Changelog: v2.1.2...v2.1.3
v2.1.2
Available on PyPI: https://pypi.org/project/pook/2.1.2/
What's Changed
- Return the correct type of
headersobject for standard library urllib by @sarayourfriend in #154. - Support
Sequence[tuple[str, str]]header input with aiohttp by @sarayourfriend in #154. - Fix network filters when multiple filters are active by @rsmeral in #155.
- Fix aiohttp matching not working with session base URL or headers by @sarayourfriend in #157.
- Add support for Python 3.13 by @sarayourfriend in #149.
New Contributors
Full Changelog: v2.1.1...v2.1.2
v2.1.1
What's Changed
- Flush mocks when
pook.activateused as a wrapper by @shift0965 in #145- This prevents mocks from leaking between test cases and should fix some potentially confusing edge case bugs.
New Contributors
- @shift0965 made their first contribution in #145
Full Changelog: v2.1.0...v2.1.1
v2.1.0
Available on PyPI: https://pypi.org/project/pook/2.1.0/
- Drop support for Python 3.8 by @sarayourfriend in #141
Full Changelog: v2.0.1...v2.1.0
v2.0.1
https://pypi.org/project/pook/2.0.1/
- Improve aiohttp JSONMatcher support by @KyleJamesWalker in #139
Full Changelog: v2.0.0...v2.0.1
v2.0.0
Available on PyPI: https://pypi.org/project/pook/2.0.0/
See #128 for a summary of the breaking changes and how to update your code if you are affected.
-
Breaking change: Remove
Response::body'sbinaryparameter and enforce a keyword argument forchunked.- The
binaryparameter is no longer needed since responses are now always byte-encoded in all cases (see below). - A keyword argument is now enforced for
chunkedto ensure unnamed arguments meant for the removedbinaryparameter cannot be confused aschunkedarguments.
- The
-
Only return byte-encoded response bodies, matching the bahviour of all supported client libraries.
- This is possible because for all supported client libraries, pook mocks the actual response sent to the
client library over the wire, which will, in all cases, be bytes. Client libraries that support reading
response content as a string or other formats will continue to work as expected, because they'll always
be handling bytes from pook. - This causes no change to application code for users of pook, except for users of the standard library
urllib,
for which this also fixed a bug where non-bytes bodies were returned by pook in certain cases. This is impossible
in real application code. If you rely on pook to mockurllibresponses and have code that handles non-bytes response
bodies, that code can be safely deleted (provided the only reason it was there was pook in the first place).
- This is possible because for all supported client libraries, pook mocks the actual response sent to the
-
Breaking change: Remove
Mock::body'sbinaryparameter.- This parameter was already unused due to a bug in the code (it was not passed through to the
BodyMatcher),
so this will not cause any changes to tests that relied on it: it didn't do anything to begin with. - The breaking change is simply the removal of the unused parameter, which should be deleted from tests using pook.
- Pook's code has also been updated to remove all cases where non-bytes objects were being handled. Instead, the body
of any interecepted request will always be stored as bytes, and only decoded when necessary for individual downstream
matchers (JSON, XML).
- This parameter was already unused due to a bug in the code (it was not passed through to the
-
Correct documentation strings for
XMLMatcherandJSONMatcherto no longer suggest they can handle regex matchers.- These classes never implemented regex matching.
-
Add a pytest fixture to the package (kudos @wimglenn)
v1.4.3
What's Changed
- Fix httpx incorrectly named method on interceptor subclass by @sarayourfriend in #126
Full Changelog: v1.4.2...v1.4.3
v1.4.2
What's Changed
- fix #122: httpx streaming via
iter_rawraiseshttpx.StreamConsumedby @petarmaric in #123
New Contributors
- @petarmaric made their first contribution in #123
Full Changelog: v1.4.1...v1.4.2
v1.4.1
What's Changed
- Fix
Mockconstructor params/url order mishandling by @sarayourfriend in #111 - Optionally match empty values in query parameter presence matcher by @sarayourfriend in #113
- Fix #115, httpx network mode by @sarayourfriend in #116
- Kudos @plyq for the report
Full Changelog: v1.4.0...v1.4.1