-
-
Notifications
You must be signed in to change notification settings - Fork 358
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
responses.add_callback
triggers DeprecationWarning beyond user's control
#464
Comments
@markstory or we can go a hard way and in next version release 1.0.0 with drop of multiple python versions and removing all deprecated parts. Then we can set default to ignore all query strings until it is explicitly defined via |
added tests to catch the behaviour described in getsentry#464
can you please check if https://github.com/beliaev-maksim/responses/tree/fix_464 fixes the issue for you |
@beliaev-maksim I'm still seeing the warning on this branch, using |
@bblommers Can you please provide minimal reproducible? |
Ah, apologies - we do explicitly add that argument, so the warning is to be expected. I cannot reproduce the warning after removing the argument! |
@bblommers |
Seems to be working:) Thanks for the quick help:) |
@jankrepl |
added tests to catch the behaviour described in getsentry#464
* added fix for wrong boolean value in add_callback * added tests to catch the behaviour described in #464
Thank you for fixing this quickly! |
@mblayman |
Steps to Reproduce
My company uses responses in combination with pytest with deprecation warnings treated as failures. The dependabot upgrade from 0.16.0 to 0.17.0 failed.
This test (which I've scrubbed to avoid sharing irrelevant and company sensitive details) triggers a DeprecationWarning upon execution.
Here is the warning:
Expected Result
This test makes no use of
match_querystring
. I would not expect to see a deprecation warning.Actual Result
A deprecation warning triggered.
I believe the reason is because
add_callback
setsmatch_querystring
toFalse
by default (see https://github.com/getsentry/responses/blob/0.17.0/responses/__init__.py#L719)._should_match_querystring
, the method where the deprecation warning is triggered, expects the more exact check ofif match_querystring_argument is not None:
(see https://github.com/getsentry/responses/blob/0.17.0/responses/__init__.py#L333)My guess is that
_should_match_querystring
should be able to check theFalse
value too to prevent disruption to theadd_callback
API.Thanks for the help. Please let me know if I can do more to help or if more information is needed.
The text was updated successfully, but these errors were encountered: