Explicitly clear PoolManager by using context manager
Fixes
This is meant to solve ResourceWarning messages when WebDrivers are instanced with a KeepAlive=False.
@@ -371,7 +371,7 @@ class RemoteConnection(object):
statuscode = resp.status
else:
- http = urllib3.PoolManager(timeout=self._timeout)
+ with urllib3.PoolManager(timeout=self._timeout) as http:
resp = http.request(method, url, body=body, headers=headers)
statuscode = resp.status
