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
Setting registry in activate sets the default mock's registry for other users of activate #563
Labels
Comments
Forty-Bot
changed the title
Setting registry in activate sets the default registry for other tests
Setting registry in activate sets the default mock's registry for other users of activate
Jun 26, 2022
@Forty-Bot |
looks like order makes a difference import responses, responses.registries
@responses.activate
def test_registry_type():
assert type(responses.mock.get_registry()) == responses.registries.FirstMatchRegistry
@responses.activate(registry=responses.registries.OrderedRegistry)
def test_something_else():
pass |
beliaev-maksim
added
bug
Status: In Progress
and removed
Status: Needs More Information
labels
Jun 27, 2022
beliaev-maksim
added a commit
to beliaev-maksim/responses
that referenced
this issue
Jun 27, 2022
Merged
@Forty-Bot and let me know if that fixes the issue on your production code? |
markstory
pushed a commit
that referenced
this issue
Jun 27, 2022
* fix registry #563 * add async test
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If the registry parameter is ever used in
activate
, it will "poison" the default registry for other tests. This is illustrated by the below reproducer:Removing the first
activate
line will cause the test to pass. The order of uses does not matter. This occurs with and without pytest. This affects responses 0.20 and 0.21 (at least) on python 3.10.2.The text was updated successfully, but these errors were encountered: