Skip to content

Record add_passthru requests in calls - #850

Open
SnakeO wants to merge 1 commit into
getsentry:masterfrom
SnakeO:fix-755-record-passthru-calls
Open

SnakeO wants to merge 1 commit into
getsentry:masterfrom
SnakeO:fix-755-record-passthru-calls

Conversation

@SnakeO

@SnakeO SnakeO commented Nov 19, 2026

Copy link
Copy Markdown

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update
  • Other

Description

okay so this is a bug fix. requests let through by add_passthru (a URL prefix or a regex) went to the real adapter but were never added to responses.calls, so responses.calls and assert_call_count() didn't see them. requests matched by a PassthroughResponse were already recorded. this records the add_passthru ones the same way.

I added call assertions to the existing test_passthru and test_passthru_regex. both failed before the change (2 calls instead of 3 and 4) and pass now. ran tox locally (py311 through py315, mypy, precom), all passing.

left alone on purpose: response_callback still isn't applied to add_passthru responses and a connection error from the real request still isn't recorded, same as before.

Related Issues

PR checklist

Before submitting this pull request, I have done the following:

Added/updated tests?

Current repository has 100% test coverage.

  • Yes
  • No, and this is why:
  • I need help with writing tests

Requests let through by an add_passthru prefix or regex went to the real
adapter without being added to responses.calls, while requests matched by
a PassthroughResponse were recorded. Record them the same way.

Fixes getsentry#755
@SnakeO
SnakeO requested a review from markstory as a code owner November 19, 2026 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using pytest fixture doesn't update calls with request/response on passthru

1 participant