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
UnmockedError to actually display which URL failed? #388
Comments
Hello @andreas-bergstrom please feel free to open a PR, I'll merge it as soon as I can |
This feature will demand some good deal of work, I'm glad to give priority to this if more people show interest, or as soon as I have time for it. |
We just had the need for this while running tests in a Django app. Django failed to connect to the DB host. If we knew the URL we could register the URI. Is there some sort of host whitelist we could use in our case? |
No whitelist support for now. |
OMG I need this. Why is this request closed? What's the workaround, besides putting print() statements in the middle of the code (httpretty/core.py line 556)? |
I'm also in the same situation again. Knowing the URL of the failed request would help a lot. |
@instantlinux and @sauloperez thanks for bumping this. I'm reopening the ticket to investigate and find a solution |
Great! I'd love to help with an implementation but I'm afraid I will only have room for code reviews in the upcoming weeks. |
@httpretty.activate(verbose=True) httpretty.enable(verbose.True) etc. Another option is to set the logger level manually import logging from httpretty.core import logger logger.setLevel(logging.DEBUG)
This has been fixed in the release 1.1.0 Besides displaying the mismatched url in the Via the logging module:import logging
logging.getLogger("httpretty.core").setLevel(logging.DEBUG) When activating httpretty (verbose=True)import httpretty
httpretty.enable(verbose=True)
# or pass to decorators
@httpretty.activate(verbose=True) @andreas-bergstrom, @sauloperez and @instantlinux please let me know if this is enough to solve your issues. |
Is there any way through configuration to have UnmockedError display which URL that it's thrown on? Or would it be OK if I made a PR for this behaviour?
The text was updated successfully, but these errors were encountered: