Feature suggestion: An option to pass through unmatched urls
See original GitHub issueI expected responses to pass through unmatched urls and spent several hours of head-scratching why I couldn’t connect to an unmocked http service in my test
No doubt I’m a bit thick and the system is too complicated and I’m doing testing wrong etc etc 😃
Eventually I realised responses
was the culprit and reading the source (see also #19) this morning I can see why…
Part of my confusion was the trace info from the “Connection refused” exception raised by responses was getting swallowed by an intermediate client library so even digging in my project code via ipdb all I could see was the text of the exception… in this case it would have been helpful if the exception message said explicitly the connection was being refused by responses (due to unmatched url).
The project I’m working on has, for better or worse, a large suite of ‘integration’ rather than ‘unit’ tests and I’d find it handy right now to have an option to pass-through unmatched urls so I can mock just a single http service and leave the rest working
it looks like HTTPretty can do either behaviour and has the opposite default https://github.com/gabrielfalcao/HTTPretty#raising-an-error-if-an-unregistered-endpoint-is-requested
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
@markstory isn’t it the same request idea as https://github.com/getsentry/responses#passing-through-real-requests ?
if yes, then we can close this issue
nice, thanks!
possibly the text of the “Connection refused” exception could still mention being refused by
responses
though?