Add bake() method for pre-configured request expectations#470
Merged
csernazs merged 1 commit intocsernazs:masterfrom Feb 12, 2026
Merged
Add bake() method for pre-configured request expectations#470csernazs merged 1 commit intocsernazs:masterfrom
bake() method for pre-configured request expectations#470csernazs merged 1 commit intocsernazs:masterfrom
Conversation
7677b29 to
88a9339
Compare
csernazs
reviewed
Feb 10, 2026
Owner
|
Thanks for the PR, I submitted my comments |
Contributor
Author
|
Thanks for the review. I submitted fix commits. Feel free to check them when you have time. |
b6c5051 to
5897e6d
Compare
Owner
|
may I ask you to write a release notes for this? You can run If you don't want, I can do that as well. |
Owner
|
hi @HayaoSuzuki , Thanks for all the changes, I think everything looks great. Could you please squash your commits? Then I'm happy to merge it. Zsolt |
- Extract to separate module and fix nested context manager - Add RequestMatcherKwargs TypedDict - Add release note of bake() method and BakedHTTPServer proxy
821f1b0 to
6f102e3
Compare
Contributor
Author
|
@csernazs I squashed some commits. Thanks for the gracious review of our PR. |
Owner
|
hi @HayaoSuzuki , This has been released with version 1.1.5. Thanks for the implementation again, |
github-actions bot
added a commit
to paulstaab/headless-rss
that referenced
this pull request
Feb 16, 2026
Bumps [pytest-httpserver](https://github.com/csernazs/pytest-httpserver) from 1.1.4 to 1.1.5. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/csernazs/pytest-httpserver/releases">pytest-httpserver's releases</a>.</em></p> <blockquote> <h2>1.1.5</h2> <h2>What's Changed</h2> <ul> <li>Add <code>bake()</code> method for pre-configured request expectations by <a href="https://github.com/HayaoSuzuki"><code>@HayaoSuzuki</code></a> in <a href="https://redirect.github.com/csernazs/pytest-httpserver/pull/470">csernazs/pytest-httpserver#470</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/csernazs/pytest-httpserver/compare/1.1.4...1.1.5">https://github.com/csernazs/pytest-httpserver/compare/1.1.4...1.1.5</a></p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/csernazs/pytest-httpserver/blob/master/CHANGES.rst">pytest-httpserver's changelog</a>.</em></p> <blockquote> <h1>1.1.5</h1> <p>.. _Release Notes_1.1.5_New Features:</p> <h2>New Features</h2> <ul> <li>Add <code>bake()</code> method to <code>HTTPServer</code> for creating pre-configured request expectation proxies (<code>BakedHTTPServer</code>). This allows sharing common keyword arguments (e.g. <code>method</code>, <code>headers</code>) across multiple <code>expect_request()</code> calls with last-wins merging semantics. <code>[#470](csernazs/pytest-httpserver#470) <https://github.com/csernazs/pytest-httpserver/pull/470></code>_ Contributed by <code>@HayaoSuzuki <https://github.com/HayaoSuzuki></code>_</li> </ul> <p>.. _Release Notes_1.1.4:</p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/csernazs/pytest-httpserver/commit/840c7d108cf045e0309fa52543cd7d2def52b1bb"><code>840c7d1</code></a> CHANGES.rst: add release notes for 1.1.5</li> <li><a href="https://github.com/csernazs/pytest-httpserver/commit/7c7be887f740473ba5ca4b73ed92fa3fd2c3f446"><code>7c7be88</code></a> Version bump to 1.1.5</li> <li><a href="https://github.com/csernazs/pytest-httpserver/commit/f1971ce844a397a8c06c8f5fabd166c67b7caf87"><code>f1971ce</code></a> fix-release: remove release notes</li> <li><a href="https://github.com/csernazs/pytest-httpserver/commit/ae956c0cbe81ce09b5591250b7a297a5d3a758c0"><code>ae956c0</code></a> release.py: fix check order</li> <li><a href="https://github.com/csernazs/pytest-httpserver/commit/c8804805cfc59f82fcd38a11e88a6c7b98df8609"><code>c880480</code></a> Make release.py more robust</li> <li><a href="https://github.com/csernazs/pytest-httpserver/commit/310529cfa618ab061eb40c9fd9335b51a9f9fd40"><code>310529c</code></a> Add bake() method for pre-configured request expectations</li> <li><a href="https://github.com/csernazs/pytest-httpserver/commit/7716cda169ffd9fd5215b18887fa09fa80ba6199"><code>7716cda</code></a> [pre-commit.ci] pre-commit autoupdate</li> <li>See full diff in <a href="https://github.com/csernazs/pytest-httpserver/compare/1.1.4...1.1.5">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) 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-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> 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 show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
HTTPServer.bake(**kwargs)which returns aBakedHTTPServerproxy with pre-configured defaults forexpect_request()and related methods.BakedHTTPServeris a lightweight proxy, such that no new server is created.bake()can be chained, such thathttpserver.bake(method="POST").bake(headers={...}).expect_*methods are supported.url_for,check_assertions, etc.) are delegated via__getattr__.__enter__and__exit__delegation.Closes #46