diff --git a/responses.py b/responses.py
index 3f32125..df42ef5 100644
--- a/responses.py
+++ b/responses.py
@@ -652,7 +652,7 @@ class RequestsMock(object):
 
         try:
             response = adapter.build_response(request, match.get_response(request))
-        except Exception as response:
+        except BaseException as response:
             match.call_count += 1
             self._calls.add(request, response)
             response = resp_callback(response) if resp_callback else response

RequestsMock._on_request misses calls if callback raises BaseException
In case a `BaseException` (or a subclass) is raised in the `get_response()` method of a match object (e.g. in a callback) the call accounting isn't updated for that call.

This then leads to test failures due to `Not all requests have been executed`.

The reason is that only `Exception`s are expected:
https://github.com/getsentry/responses/blob/8b0b9c1883c1242246af3dd535df79bfb071732a/responses.py#L642-L648

I noticed this in the context of `gevent` and its `Timeout` feature which raises an exception inherited from `BaseException`.
diff --git a/test_responses.py b/test_responses.py
index 41400ee..af41f3a 100644
--- a/test_responses.py
+++ b/test_responses.py
@@ -749,6 +749,9 @@ def test_response_filebody():
 
 
 def test_assert_all_requests_are_fired():
+    def request_callback(request):
+        raise BaseException()
+
     def run():
         with pytest.raises(AssertionError) as excinfo:
             with responses.RequestsMock(assert_all_requests_are_fired=True) as m:
@@ -782,6 +785,13 @@ def test_assert_all_requests_are_fired():
                 requests.get("http://example.com")
             assert len(m._matches) == 1
 
+        with responses.RequestsMock(assert_all_requests_are_fired=True) as m:
+            m.add_callback(responses.GET, "http://example.com", request_callback)
+            assert len(m._matches) == 1
+            with pytest.raises(BaseException):
+                requests.get("http://example.com")
+            assert len(m._matches) == 1
+
     run()
     assert_reset()
 

pip install -e .[tests]
parse_log_pytest
requirements.txt
pytest pytest-cov pytest-localserver flake8
apt-get update apt-get install -y gcc
3.7
requirements/base.txt
pytest . --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
certifi @ file:///croot/certifi_1671487769961/work/certifi
charset-normalizer==3.4.1
coverage==4.5.4
exceptiongroup==1.2.2
flake8==5.0.4
idna==3.10
importlib-metadata==4.2.0
iniconfig==2.0.0
MarkupSafe==2.1.5
mccabe==0.7.0
packaging==24.0
pluggy==1.2.0
pycodestyle==2.9.1
pyflakes==2.5.0
pytest==7.4.4
pytest-cov==2.10.1
pytest-localserver==0.9.0.post0
requests==2.31.0
-e git+https://github.com/getsentry/responses.git@72a60d9be44a46ac2cda442a8105c3c4f9e86458#egg=responses
six==1.17.0
tomli==2.0.1
typing_extensions==4.7.1
urllib3==2.0.7
Werkzeug==2.2.3
zipp==3.15.0

name: responses
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=22.3.1=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - charset-normalizer==3.4.1
      - coverage==4.5.4
      - exceptiongroup==1.2.2
      - flake8==5.0.4
      - idna==3.10
      - importlib-metadata==4.2.0
      - iniconfig==2.0.0
      - markupsafe==2.1.5
      - mccabe==0.7.0
      - packaging==24.0
      - pluggy==1.2.0
      - pycodestyle==2.9.1
      - pyflakes==2.5.0
      - pytest==7.4.4
      - pytest-cov==2.10.1
      - pytest-localserver==0.9.0.post0
      - requests==2.31.0
      - six==1.17.0
      - tomli==2.0.1
      - typing-extensions==4.7.1
      - urllib3==2.0.7
      - werkzeug==2.2.3
      - zipp==3.15.0
prefix: /opt/conda/envs/responses

test_responses.py::test_assert_all_requests_are_fired
test_responses.py::test_response test_responses.py::test_response_encoded test_responses.py::test_response_with_instance test_responses.py::test_replace[http://example.com/two-http://example.com/two] test_responses.py::test_replace[original1-replacement1] test_responses.py::test_replace[http://example\\.com/two-http://example\\.com/two] test_responses.py::test_replace_error[http://example.com/one-http://example\\.com/one] test_responses.py::test_replace_error[http://example\\.com/one-http://example.com/one] test_responses.py::test_remove test_responses.py::test_response_equality[args10-kwargs10-args20-kwargs20-True] test_responses.py::test_response_equality[args11-kwargs11-args21-kwargs21-False] test_responses.py::test_response_equality[args12-kwargs12-args22-kwargs22-False] test_responses.py::test_response_equality[args13-kwargs13-args23-kwargs23-True] test_responses.py::test_response_equality_different_objects test_responses.py::test_connection_error test_responses.py::test_match_querystring test_responses.py::test_match_empty_querystring test_responses.py::test_match_querystring_error test_responses.py::test_match_querystring_regex test_responses.py::test_match_querystring_error_regex test_responses.py::test_match_querystring_auto_activates test_responses.py::test_accept_string_body test_responses.py::test_accept_json_body test_responses.py::test_no_content_type test_responses.py::test_arbitrary_status_code test_responses.py::test_throw_connection_error_explicit test_responses.py::test_callback test_responses.py::test_callback_exception_result test_responses.py::test_callback_exception_body test_responses.py::test_callback_no_content_type test_responses.py::test_regular_expression_url test_responses.py::test_custom_adapter test_responses.py::test_responses_as_context_manager test_responses.py::test_activate_doesnt_change_signature test_responses.py::test_activate_mock_interaction test_responses.py::test_activate_doesnt_change_signature_with_return_type test_responses.py::test_activate_doesnt_change_signature_for_method test_responses.py::test_response_cookies test_responses.py::test_response_secure_cookies test_responses.py::test_response_cookies_multiple test_responses.py::test_response_callback test_responses.py::test_response_filebody test_responses.py::test_allow_redirects_samehost test_responses.py::test_handles_unicode_querystring test_responses.py::test_handles_unicode_url test_responses.py::test_headers test_responses.py::test_legacy_adding_headers test_responses.py::test_multiple_responses test_responses.py::test_multiple_urls test_responses.py::test_passthru test_responses.py::test_passthru_regex test_responses.py::test_method_named_param test_responses.py::test_passthru_unicode test_responses.py::test_custom_target test_responses.py::test_cookies_from_headers
responses.py
responses.py