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
With the code below, the last call should return a 502 but it returns a 404.
If I remove or change the first session.get() to call another domain it will work.
This is a bit frustrating as I cannot fully use this library to test an http client with a fixed domain.
import httpretty
import requests
session = requests.Session()
r = session.get("https://google.com/foo")
with httpretty.enabled():
httpretty.register_uri(
httpretty.GET,
'https://google.com/bar',
status=502,
)
r = session.get("https://google.com/bar")
print(r)
print("nb requests done with httpretty:", len(httpretty.httpretty.latest_requests))
httpretty 0.9.6
requests 2.22.0
Thank you very much,
The text was updated successfully, but these errors were encountered:
The first time you use the session r = session.get("https://google.com/foo"), a connection pool will be made for the host google.com and will be stored in a pool list inside the session object.
A real socket/connection will be created to make the actual request. Since you are using a Session, the real socket will stay in the pool for google.com after the first request completes.
With the code below, the last call should return a 502 but it returns a 404.
If I remove or change the first
session.get()
to call another domain it will work.This is a bit frustrating as I cannot fully use this library to test an http client with a fixed domain.
httpretty 0.9.6
requests 2.22.0
Thank you very much,
The text was updated successfully, but these errors were encountered: