Skip to content

Releases: h2non/pook

v2.1.1

15 Oct 03:08
4f0ccf2
Compare
Choose a tag to compare

What's Changed

  • Flush mocks when pook.activate used 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

Full Changelog: v2.1.0...v2.1.1

v2.1.0

08 Oct 05:34
34ac39e
Compare
Choose a tag to compare

Available on PyPI: https://pypi.org/project/pook/2.1.0/

Full Changelog: v2.0.1...v2.1.0

v2.0.1

08 Oct 03:21
3e3a93d
Compare
Choose a tag to compare

https://pypi.org/project/pook/2.0.1/

Full Changelog: v2.0.0...v2.0.1

v2.0.0

01 Jul 00:31
d9e739f
Compare
Choose a tag to compare

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's binary parameter and enforce a keyword argument for chunked.

    • The binary parameter is no longer needed since responses are now always byte-encoded in all cases (see below).
    • A keyword argument is now enforced for chunked to ensure unnamed arguments meant for the removed binary parameter cannot be confused as chunked arguments.
  • 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 mock urllib responses 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).
  • Breaking change: Remove Mock::body's binary parameter.

    • 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).
  • Correct documentation strings for XMLMatcher and JSONMatcher to 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

23 Feb 00:25
ef5bb1a
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.4.2...v1.4.3

https://pypi.org/project/pook/1.4.3/

v1.4.2

14 Feb 21:41
e66193b
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.4.1...v1.4.2

v1.4.1

12 Feb 03:09
7d1885b
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.4.0...v1.4.1

https://pypi.org/project/pook/1.4.1/

v1.4.0

28 Dec 22:48
fac40e9
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.3.0...v1.4.0

v1.3.0

25 Dec 02:40
6d7fb73
Compare
Choose a tag to compare

This release modernizes Pook build and development environments.

  • Drop support for EOL'd Python versions (in other words, 3.6 and 3.7)
  • Use pyproject.toml
  • Use ruff to lint files
  • Use pre-commit to add pre-commit hooks
  • Use hatch to manage test, development, and build environments
  • Fix the test configuration to actually run the example tests
  • Fix the documentation build
  • Fix support for asynchronous functions in the activate decorator (this was a direct result of re-enabling the example tests and finding lots of little issues)
  • Remove all mention of the unsupported pycurl library
  • Clean up tests that can use pytest parametrize to do so (and get better debugging information during tests runs as a result)
  • Use pytest-pook to clean up a bunch of unnecessary test fixtures
  • Fix deprecation warning for invalid string escape sequences caused by untagged regex strings

v1.2.1

23 Dec 03:52
4fae97d
Compare
Choose a tag to compare

https://pypi.org/project/pook/1.2.1/

What's Changed

Full Changelog: v1.2.0...v1.2.1