question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature suggestion: An option to pass through unmatched urls

See original GitHub issue

I 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:closed
  • Created 8 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
beliaev-maksimcommented, Jan 7, 2022

@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

1reaction
anentropiccommented, Jul 29, 2015

nice, thanks!

possibly the text of the “Connection refused” exception could still mention being refused by responses though?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unmatched Requests Passthrough Rule - Fiddler Everywhere
Creating basic "Unmatched Requests Non-Passthrough (except for )" rule: Open the Rules tab and use Add New Rule to create new rule. Set...
Read more >
Add option to allow unmatched fakeServer requests to be ...
I am using sinon.fakeServer to stub out an as-yet-unfinished backend on a large project. However, a number of endpoints are already complete ...
Read more >
How does Suggestions Work?
I'm trying to limit the number of duplicates in my database by putting the URLs of each internal company website in my "Domain...
Read more >
Rewrite HTTP headers and URL with Application Gateway
This article provides an overview of rewriting HTTP headers and URL in Azure Application Gateway.
Read more >
Destination requirements - Advertising Policies Help
The landing page is where people actually end up after passing through any redirects associated with the destination URL, final URL, or tracking...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found