New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed the issue when reset()
method was called in not stopped mock
#516
Conversation
Codecov Report
@@ Coverage Diff @@
## master #516 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 6 6
Lines 2305 2315 +10
=========================================
+ Hits 2305 2315 +10
Continue to review full report at Codecov.
|
responses/tests/test_responses.py
Outdated
with responses.RequestsMock() as rsps2: | ||
rsps2.reset() | ||
responses.add(responses.GET, "https://example.invalid", status=200) | ||
print(requests.request("GET", "https://example.invalid")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be an assertion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@markstory
confirm that
# Conflicts: # CHANGES
658c0e8
to
f1e38e4
Compare
f1e38e4
to
42415ef
Compare
closes #511
Fix the issue - one line of code, know where to fix the issue - 1.5h :D
explanation:
when reset in the middle, we clean up
_patcher
which is a req for another issue. But when we do it, it prevents patcher to be stopped.In PR test case actual mock is applied from
rsps2
instead ofresponses.mock
because we did not clean up patcher on exit from the context manager