-
-
Notifications
You must be signed in to change notification settings - Fork 370
Comparing changes
Open a pull request
base repository: getsentry/responses
base: 0.26.0
head repository: getsentry/responses
compare: 0.26.2
- 15 commits
- 14 files changed
- 14 contributors
Commits on Feb 19, 2026
-
getsentry-bot committed
Feb 19, 2026 Configuration menu - View commit details
-
Copy full SHA for cc53d77 - Browse repository at this point
Copy the full SHA cc53d77View commit details
Commits on Mar 23, 2026
-
Configuration menu - View commit details
-
Copy full SHA for 3da192e - Browse repository at this point
Copy the full SHA 3da192eView commit details
Commits on Apr 10, 2026
-
Add Spanish translation of the README documentation (#790)
* Adds spanish documentation * Adds spanish documentation to CHANGES
Configuration menu - View commit details
-
Copy full SHA for 84c2b08 - Browse repository at this point
Copy the full SHA 84c2b08View commit details
Commits on May 7, 2026
-
fix: remove content-type from headers in _add_from_file to avoid Runt…
…imeError (#791) * fix: remove content-type from headers in _add_from_file to avoid RuntimeError The recorder stores content_type as a top-level YAML key but may also capture a 'content-type' entry inside the headers dict (since HTTP servers return Content-Type as a response header). When _add_from_file() calls add() with both content_type= and headers={'content-type': ...}, add() raises: RuntimeError: You cannot define both content_type and headers[Content-Type]. Fix: strip any 'content-type' key from headers before calling add() when content_type is also present in the loaded response dict. The content_type kwarg takes precedence, which is already documented as the recommended approach. Fixes #741 * test: add regression test for Content-Type conflict in _add_from_file Fixes the case where a YAML fixture has Content-Type in both headers and content_type fields — the recorder captures both, causing RuntimeError when _add_from_file calls add(). Added test_add_from_file_content_type_in_headers to verify the fix works end-to-end with a YAML fixture. * test: use mismatched Content-Type values to verify content_type precedence Per markstory's review: using different values for headers['Content-Type'] ('text/html') and content_type ('application/json'/'text/plain') makes the assertion non-trivial — it now explicitly verifies that content_type wins over the conflicting header, not just that both happen to carry the same value. * fix(test): use .yaml extension so _add_from_file selects YAML loader As suggested by @markstory — the fixture file needs an explicit extension so that _add_from_file can detect the correct loader. Changed out_file to use a .yaml suffix for the content_type_in_headers test. * fix(test): clean up .yaml/.toml fixture variants in teardown_method The content_type test creates response_record.yaml but teardown_method only deleted response_record (no extension). Add cleanup for .yaml and .toml variants to avoid stale artifacts across test runs. * fix(test): restore _parse_response_file in teardown + reformat for black Root cause of the CI failure: test_add_from_file[tomli_w] monkey-patches responses.mock._parse_response_file to a TOML loader and never restores it, so test_add_from_file_content_type_in_headers inherits the TOML parser and chokes on the YAML fixture (tomllib.TOMLDecodeError). The prior fixes (.yaml extension, .yaml/.toml teardown cleanup) don't help because _parse_response_file always calls yaml.safe_load regardless of file extension — the bug is in test state leakage, not the loader dispatch. - teardown_method: always reset _parse_response_file back to the class default so any per-test monkey-patch is contained. - __init__.py: black wrap for the Content-Type-stripping dict comp (was 91 chars, over the 88-char limit). * fix(test): unwind mock inside test_add_from_file instead of teardown per markstory's review: capture the original `_parse_response_file` before monkey-patching it for the tomli_w parametrize variant, then restore it in a finally block so the mock is contained to the test that introduces it. removes the class-wide reset from teardown_method that was leaking responsibility upward. --------- Co-authored-by: Julio César Suástegui <juliosuas@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 71be9a2 - Browse repository at this point
Copy the full SHA 71be9a2View commit details
Commits on May 8, 2026
-
chore: Fix lint build and update changes (#795)
* chore: Fix lint build and update changes * Fix mypy better
Configuration menu - View commit details
-
Copy full SHA for ab8d480 - Browse repository at this point
Copy the full SHA ab8d480View commit details
Commits on May 21, 2026
-
Add strict_match parameter to urlencoded_params_matcher (#796)
* Add strict_match parameter to urlencoded_params_matcher * Add to CHANGES the new strict_match param for urlencoded_params_matcher * Prevent non-strict matching of empty params with non-empty body * Test for successful strict matching * Check for falsy/truthy params and request_body instead of None With this change, "params={}" has the same effect as "params=None". * Show note when match fails and strict match is ONConfiguration menu - View commit details
-
Copy full SHA for 1fda897 - Browse repository at this point
Copy the full SHA 1fda897View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7a80232 - Browse repository at this point
Copy the full SHA 7a80232View commit details -
Configuration menu - View commit details
-
Copy full SHA for 705067b - Browse repository at this point
Copy the full SHA 705067bView commit details
Commits on Jun 3, 2026
-
Configuration menu - View commit details
-
Copy full SHA for 853e7d2 - Browse repository at this point
Copy the full SHA 853e7d2View commit details
Commits on Jun 18, 2026
-
Configuration menu - View commit details
-
Copy full SHA for 1d48f2f - Browse repository at this point
Copy the full SHA 1d48f2fView commit details
Commits on Jun 25, 2026
-
Strip default headers from recorded files case-insensitively (#798)
_remove_default_headers matched header names by exact case, so the default headers (Content-Type, Date, Server, and the others) were only stripped when servers used the canonical casing. HTTP header names are case-insensitive and HTTP/2 servers send them lowercase, so responses recorded from such servers kept these redundant headers in the file. Match the names without regard to case.
Configuration menu - View commit details
-
Copy full SHA for 88e15db - Browse repository at this point
Copy the full SHA 88e15dbView commit details
Commits on Jun 26, 2026
-
fix: query_param_matcher no longer mutates the caller's params dict (#…
…801) Numeric values (int/float) in the params mapping were being converted to strings in-place, silently modifying the original dict passed by the caller. Copy the mapping into a local dict before performing the int/float→str normalisation. --------- Co-authored-by: gaoflow <claude@vinzzy.uk>
Configuration menu - View commit details
-
Copy full SHA for a19add7 - Browse repository at this point
Copy the full SHA a19add7View commit details
Commits on Jul 3, 2026
-
Set license format to SPDX identifier in setup.py (#803)
Right now the License uses `Apache 2.0` instead of the SPDX compliant `Apache-2.0`. This causes problems with some license scanners like https://github.com/anchore/grant
Configuration menu - View commit details
-
Copy full SHA for aae1d47 - Browse repository at this point
Copy the full SHA aae1d47View commit details -
Move recently merged changes under a new heading instead of under 0.26.1 which has already been released.
Configuration menu - View commit details
-
Copy full SHA for 6fb610d - Browse repository at this point
Copy the full SHA 6fb610dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 31d28eb - Browse repository at this point
Copy the full SHA 31d28ebView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff 0.26.0...0.26.2