You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm investigating various approaches for using py.test to unit test some code which makes HTTP requests. (It's a class that invokes webhooks in the background.)
I like the approach of pytest-httpbin, because using fixtures can keep the test cases from getting too cluttered with extraneous setup/teardown code. However, I'm not too keen on the idea of spawning an actual HTTP server in the background, because the code under test is already using a known-good HTTP client library.
What about using wsgi_intercept? It basically does what it says on the tin: intercept outgoing HTTP requests and redirect them to an in-process WSGI application. No actual HTTP client or server is involved!
Any reason why this wouldn't work or isn't a good idea? Would you accept a pull request that implemented this feature?
The text was updated successfully, but these errors were encountered:
I'm investigating various approaches for using py.test to unit test some code which makes HTTP requests. (It's a class that invokes webhooks in the background.)
I like the approach of pytest-httpbin, because using fixtures can keep the test cases from getting too cluttered with extraneous setup/teardown code. However, I'm not too keen on the idea of spawning an actual HTTP server in the background, because the code under test is already using a known-good HTTP client library.
What about using wsgi_intercept? It basically does what it says on the tin: intercept outgoing HTTP requests and redirect them to an in-process WSGI application. No actual HTTP client or server is involved!
Any reason why this wouldn't work or isn't a good idea? Would you accept a pull request that implemented this feature?
The text was updated successfully, but these errors were encountered: