Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: getsentry/responses
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.26.0
Choose a base ref
...
head repository: getsentry/responses
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0.26.2
Choose a head ref
  • 15 commits
  • 14 files changed
  • 14 contributors

Commits on Feb 19, 2026

  1. Merge branch 'release/0.26.0'

    getsentry-bot committed Feb 19, 2026
    Configuration menu
    Copy the full SHA
    cc53d77 View commit details
    Browse the repository at this point in the history

Commits on Mar 23, 2026

  1. Configuration menu
    Copy the full SHA
    3da192e View commit details
    Browse the repository at this point in the history

Commits on Apr 10, 2026

  1. Add Spanish translation of the README documentation (#790)

    * Adds spanish documentation
    * Adds spanish documentation to CHANGES
    jlariza authored Apr 10, 2026
    Configuration menu
    Copy the full SHA
    84c2b08 View commit details
    Browse the repository at this point in the history

Commits on May 7, 2026

  1. 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>
    juliosuas and juliosuas authored May 7, 2026
    Configuration menu
    Copy the full SHA
    71be9a2 View commit details
    Browse the repository at this point in the history

Commits on May 8, 2026

  1. chore: Fix lint build and update changes (#795)

    * chore: Fix lint build and update changes
    * Fix mypy better
    markstory authored May 8, 2026
    Configuration menu
    Copy the full SHA
    ab8d480 View commit details
    Browse the repository at this point in the history

Commits on May 21, 2026

  1. 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 ON
    o-alquimista authored May 21, 2026
    Configuration menu
    Copy the full SHA
    1fda897 View commit details
    Browse the repository at this point in the history
  2. release: 0.26.1

    markstory committed May 21, 2026
    Configuration menu
    Copy the full SHA
    7a80232 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    705067b View commit details
    Browse the repository at this point in the history

Commits on Jun 3, 2026

  1. Configuration menu
    Copy the full SHA
    853e7d2 View commit details
    Browse the repository at this point in the history

Commits on Jun 18, 2026

  1. docs: fix typos (#800)

    juliosuas authored Jun 18, 2026
    Configuration menu
    Copy the full SHA
    1d48f2f View commit details
    Browse the repository at this point in the history

Commits on Jun 25, 2026

  1. 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.
    golikovichev authored Jun 25, 2026
    Configuration menu
    Copy the full SHA
    88e15db View commit details
    Browse the repository at this point in the history

Commits on Jun 26, 2026

  1. 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>
    gaoflow and gaoflow authored Jun 26, 2026
    Configuration menu
    Copy the full SHA
    a19add7 View commit details
    Browse the repository at this point in the history

Commits on Jul 3, 2026

  1. 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
    psuet authored Jul 3, 2026
    Configuration menu
    Copy the full SHA
    aae1d47 View commit details
    Browse the repository at this point in the history
  2. Fix CHANGES (#802)

    Move recently merged changes under a new heading instead of under 0.26.1
    which has already been released.
    markstory authored Jul 3, 2026
    Configuration menu
    Copy the full SHA
    6fb610d View commit details
    Browse the repository at this point in the history
  3. release: 0.26.2

    markstory committed Jul 3, 2026
    Configuration menu
    Copy the full SHA
    31d28eb View commit details
    Browse the repository at this point in the history
Loading