Repository: getsentry/responses

Issue:
Reset not triggered when assert_all_requests_are_fired raises using decorator
### Describe the bug

I am not sure if `@responses.activate(assert_all_requests_are_fired=True)` is used normally but I found it easy to use for pytest tests. However, I found a problem using it this way:

See example. The second function here will fail since `RequestsMock.__exit__()` raises in `self.stop()` and therefore never reaches `self.reset()`.

A easy and solid fix would be to implement it like this:
```
    def __exit__(self, type: Any, value: Any, traceback: Any) -> bool:
        success = type is None
        try:
            self.stop(allow_assert=success)
        finally:
            self.reset()
        return success
```


### Additional context

_No response_

### Version of `responses`

0.22.0

### Steps to Reproduce

```python

@responses.activate(assert_all_requests_are_fired=True)
def test_some_function():
    # This one does not reset
    responses.add(responses.GET, 'other_url', json={})
    requests.get('some_api')


@responses.activate(assert_all_requests_are_fired=True)
def test_some_second_function():
    # This one will fail
    responses.add(responses.GET, 'some_api', json={})
    requests.get('some_api')
```

### Expected Result

Consecutive tests in pytest should not fail.

### Actual Result

Consecutive tests in pytest now fail because `reset()` is not triggered in previous tests.

Discussion:
codecov[bot]: # [Codecov](https://app.codecov.io/gh/getsentry/responses/compare/622?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=getsentry) Report
Base: **100.00**% // Head: **100.00**% // No change to project coverage :thumbsup:
> Coverage data is based on head [(`752447b`)](https://app.codecov.io/gh/getsentry/responses/compare/622?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=getsentry) compared to base [(`faf6dd9`)](https://codecov.io/gh/getsentry/responses/commit/faf6dd9afa209e9b3c6b8254ed853ff4067519a1?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=getsentry).
> Patch coverage: 100.00% of modified lines in pull request are covered.

<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff            @@
##            master      #622   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            9         9           
  Lines         2801      2817   +16     
=========================================
+ Hits          2801      2817   +16     
```


| [Impacted Files](https://app.codecov.io/gh/getsentry/responses/compare/622?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=getsentry) | Coverage Δ | |
|---|---|---|
| [responses/\_\_init\_\_.py](https://app.codecov.io/gh/getsentry/responses/compare/622?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=getsentry#diff-cmVzcG9uc2VzL19faW5pdF9fLnB5) | `100.00% <100.00%> (ø)` | |
| [responses/tests/test\_responses.py](https://app.codecov.io/gh/getsentry/responses/compare/622?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=getsentry#diff-cmVzcG9uc2VzL3Rlc3RzL3Rlc3RfcmVzcG9uc2VzLnB5) | `100.00% <100.00%> (ø)` | |

Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=getsentry). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=getsentry)

</details>

[:umbrella: View full report at Codecov](https://app.codecov.io/gh/getsentry/responses/compare/622?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=getsentry).   
:loudspeaker: Do you have feedback about the report comment? [Let us know in this issue](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=getsentry).


Patch:
diff --git a/CHANGES b/CHANGES
index 5542677..325a044 100644
--- a/CHANGES
+++ b/CHANGES
@@ -5,6 +5,7 @@
 * Fix type annotations of `CallList`. See #593
 * Replaced toml with tomli and tomli-w.
 * `request` object is attached to any custom exception provided as `Response` `body` argument. See #588
+* Fixed mocked responses leaking between tests when `assert_all_requests_are_fired` and a request was not fired.
 
 0.22.0
 ------
diff --git a/responses/__init__.py b/responses/__init__.py
index 937b5c7..a24e12c 100644
--- a/responses/__init__.py
+++ b/responses/__init__.py
@@ -924,8 +924,10 @@ class RequestsMock(object):
 
     def __exit__(self, type: Any, value: Any, traceback: Any) -> bool:
         success = type is None
-        self.stop(allow_assert=success)
-        self.reset()
+        try:
+            self.stop(allow_assert=success)
+        finally:
+            self.reset()
         return success
 
     @overload


Test patch:
diff --git a/responses/tests/test_responses.py b/responses/tests/test_responses.py
index e8197a3..90c1d65 100644
--- a/responses/tests/test_responses.py
+++ b/responses/tests/test_responses.py
@@ -1133,6 +1133,28 @@ def test_assert_all_requests_are_fired():
     assert_reset()
 
 
+def test_assert_all_requests_fired_multiple():
+    @responses.activate(assert_all_requests_are_fired=True)
+    def test_some_function():
+        # Not all mocks are called so we'll get an AssertionError
+        responses.add(responses.GET, "http://other_url", json={})
+        responses.add(responses.GET, "http://some_api", json={})
+        requests.get("http://some_api")
+
+    @responses.activate(assert_all_requests_are_fired=True)
+    def test_some_second_function():
+        # This should pass as mocks should be reset.
+        responses.add(responses.GET, "http://some_api", json={})
+        requests.get("http://some_api")
+
+    with pytest.raises(AssertionError):
+        test_some_function()
+    assert_reset()
+
+    test_some_second_function()
+    assert_reset()
+
+
 def test_allow_redirects_samehost():
     redirecting_url = "http://example.com"
     final_url_path = "/1"