Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pytest-httpx requirement from ~=0.31.1 to ~=0.32.0 in the dependencies group #67

Merged
merged 2 commits into from
Oct 1, 2024

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Sep 30, 2024

Updates the requirements on pytest-httpx to permit the latest version.
Updates pytest-httpx to 0.32.0

Release notes

Sourced from pytest-httpx's releases.

0.32.0 (2024-09-27)

Added

  • The following option is now available:
    • can_send_already_matched_responses (boolean), defaulting to False.
  • Assertion failure message in case of unmatched responses is now linking documentation on how to deactivate the check.
  • Assertion failure message in case of unmatched requests is now linking documentation on how to deactivate the check.
  • httpx.TimeoutException message issued in case of unmatched request is now linking documentation on how to reuse responses (in case some responses are already matched).

Fixed

  • Documentation now clearly state the risks associated with changing the default options.
  • Assertion failure message in case of unmatched requests at teardown is now describing requests in a more user-friendly way.
  • Assertion failure message in case of unmatched requests at teardown is now prefixing requests with - to highlight the fact that this is a list, preventing misapprehension in case only one element exists.
  • Assertion failure message in case of unmatched responses at teardown is now prefixing responses with - to highlight the fact that this is a list, preventing misapprehension in case only one element exists.
  • httpx.TimeoutException message issued in case of unmatched request is now prefixing available responses with - to highlight the fact that this is a list, preventing misapprehension in case only one element exists.
  • httpx.TimeoutException message issued in case of unmatched request is now listing unmatched responses (in registration order) before already matched one (still in registration order).
    • The incentive behind this change is to help identify a potential mismatch faster as the first unmatched response is the most likely to be the one expected to match.
  • Response description in failure messages (httpx.TimeoutException message issued in case of unmatched request or assertion failure message in case of unmatched responses at teardown) is now displaying if the response was already matched or not and less misleading in it's phrasing about what it can match (a single request by default).

Changed

  • Last registered matching response will not be reused by default anymore in case all matching responses have already been sent.
    • This behavior can be changed thanks to the new pytest.mark.httpx_mock(can_send_already_matched_responses=True) option.
    • The incentive behind this change is to spot regression if a request was issued more than the expected number of times.
  • HTTPXMock class was only exposed for type hinting purpose. This is now explained in the class docstring.
    • As a result this is the last time a change to __init__ signature will be documented and considered a breaking change.
    • Future changes will not be documented and will be considered as internal refactoring not worth a version bump.
    • __init__ now expects one parameter, the newly introduced (since [0.31.0]) options.
  • HTTPXMockOptions class was never intended to be exposed and is now marked as private.
Changelog

Sourced from pytest-httpx's changelog.

[0.32.0] - 2024-09-27

Added

  • The following option is now available:
    • can_send_already_matched_responses (boolean), defaulting to False.
  • Assertion failure message in case of unmatched responses is now linking documentation on how to deactivate the check.
  • Assertion failure message in case of unmatched requests is now linking documentation on how to deactivate the check.
  • httpx.TimeoutException message issued in case of unmatched request is now linking documentation on how to reuse responses (in case some responses are already matched).

Fixed

  • Documentation now clearly state the risks associated with changing the default options.
  • Assertion failure message in case of unmatched requests at teardown is now describing requests in a more user-friendly way.
  • Assertion failure message in case of unmatched requests at teardown is now prefixing requests with - to highlight the fact that this is a list, preventing misapprehension in case only one element exists.
  • Assertion failure message in case of unmatched responses at teardown is now prefixing responses with - to highlight the fact that this is a list, preventing misapprehension in case only one element exists.
  • httpx.TimeoutException message issued in case of unmatched request is now prefixing available responses with - to highlight the fact that this is a list, preventing misapprehension in case only one element exists.
  • httpx.TimeoutException message issued in case of unmatched request is now listing unmatched responses (in registration order) before already matched one (still in registration order).
    • The incentive behind this change is to help identify a potential mismatch faster as the first unmatched response is the most likely to be the one expected to match.
  • Response description in failure messages (httpx.TimeoutException message issued in case of unmatched request or assertion failure message in case of unmatched responses at teardown) is now displaying if the response was already matched or not and less misleading in it's phrasing about what it can match (a single request by default).

Changed

  • Last registered matching response will not be reused by default anymore in case all matching responses have already been sent.
    • This behavior can be changed thanks to the new pytest.mark.httpx_mock(can_send_already_matched_responses=True) option.
    • The incentive behind this change is to spot regression if a request was issued more than the expected number of times.
  • HTTPXMock class was only exposed for type hinting purpose. This is now explained in the class docstring.
    • As a result this is the last time a change to __init__ signature will be documented and considered a breaking change.
    • Future changes will not be documented and will be considered as internal refactoring not worth a version bump.
    • __init__ now expects one parameter, the newly introduced (since [0.31.0]) options.
  • HTTPXMockOptions class was never intended to be exposed and is now marked as private.

[0.31.2] - 2024-09-23

Fixed

  • httpx_mock marker can now be defined at different levels for a single test.

[0.31.1] - 2024-09-22

Fixed

  • It is now possible to match on content provided as async iterable by the client.

[0.31.0] - 2024-09-20

Changed

  • Tests will now fail at teardown by default if some requests were issued but were not matched.
    • This behavior can be changed thanks to the new pytest.mark.httpx_mock(assert_all_requests_were_expected=False) option.
    • The incentive behind this change is to spot unexpected requests in case code is swallowing httpx.TimeoutException.
  • The httpx_mock fixture is now configured using a marker (many thanks to Frazer McLean).
    # Apply marker to whole module
    pytestmark = pytest.mark.httpx_mock(assert_all_responses_were_requested=False)
    Or to specific tests
    @​pytest.mark.httpx_mock(non_mocked_hosts=[...])
    def test_foo(httpx_mock):
    ...

... (truncated)

Commits
  • dcc725f Merge pull request #160 from Colin-b/develop
  • 2da1848 Avoid unused variables with a dedicated name
  • 50bd257 Document how to use httpx.URL
  • 179007e Document the new link
  • 9ddead6 Link response reuse documentation
  • 08b3803 Release version 0.32.0
  • 853c5f7 Keep number of tests up to date
  • 33cd894 Merge remote-tracking branch 'origin/develop' into feature/toggle_repeat
  • d9a9b86 Cleanup failure description for can_send_already_matched_responses users as well
  • 356026b Cleanup failure description
  • Additional commits viewable in compare view

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore <dependency name> major version will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)
  • @dependabot ignore <dependency name> minor version will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)
  • @dependabot ignore <dependency name> will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)
  • @dependabot unignore <dependency name> will remove all of the ignore conditions of the specified dependency
  • @dependabot unignore <dependency name> <ignore condition> will remove the ignore condition of the specified dependency and ignore conditions

@dependabot dependabot bot added CI/CD Continuous integration (CI) and/or continuous deployment (CD) priority/low LOW priority issue/PR skip-changelog Skip this issue/PR in the CHANGELOG labels Sep 30, 2024
@dependabot dependabot bot requested a review from CasperWA September 30, 2024 01:49
@CasperWA
Copy link
Collaborator

CasperWA commented Oct 1, 2024

@dependabot recreate

Updates the requirements on [pytest-httpx](https://github.com/Colin-b/pytest_httpx) to permit the latest version.

Updates `pytest-httpx` to 0.32.0
- [Release notes](https://github.com/Colin-b/pytest_httpx/releases)
- [Changelog](https://github.com/Colin-b/pytest_httpx/blob/develop/CHANGELOG.md)
- [Commits](Colin-b/pytest_httpx@v0.31.1...v0.32.0)

---
updated-dependencies:
- dependency-name: pytest-httpx
  dependency-type: direct:production
  dependency-group: dependencies
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot force-pushed the dependabot/pip/main/dependencies-7199898936 branch from 972b7db to 88649ea Compare October 1, 2024 07:19
Where it makes sense.

While this will hide the actual number of requests performed, it should
not be an issue here. However, this _is_ a point, where some
optimization could possibly take place.
@CasperWA CasperWA changed the title Update pytest-httpx requirement from ~=0.31.1 to >=0.31.1,<0.33.0 in the dependencies group Update pytest-httpx requirement from ~=0.31.1 to ~=0.32.0 in the dependencies group Oct 1, 2024
@CasperWA CasperWA enabled auto-merge (squash) October 1, 2024 07:32
@CasperWA CasperWA merged commit 78d0ee1 into main Oct 1, 2024
11 checks passed
@CasperWA CasperWA deleted the dependabot/pip/main/dependencies-7199898936 branch October 1, 2024 07:33
Copy link

codecov bot commented Oct 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.64%. Comparing base (01863eb) to head (661f768).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #67   +/-   ##
=======================================
  Coverage   79.64%   79.64%           
=======================================
  Files          14       14           
  Lines         899      899           
=======================================
  Hits          716      716           
  Misses        183      183           
Flag Coverage Δ
pytest 79.64% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/CD Continuous integration (CI) and/or continuous deployment (CD) priority/low LOW priority issue/PR skip-changelog Skip this issue/PR in the CHANGELOG
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant