Skip to content
Snippets Groups Projects
Commit 1dd7e242 authored by Marc Abramowitz's avatar Marc Abramowitz
Browse files

Merge pull request #10 from msabramo/monkeypatch_requests.request

Monkeypatch requests.request
parents 39f4c195 e6e8040e
No related branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,8 @@ class monkeypatch(object):
requests = self._get_global_requests_module()
self.orig_requests_get = requests.get
requests.get = self.session.get
self.orig_requests_request = requests.request
requests.request = self.session.request
def _get_global_requests_module(self):
return sys.modules['requests']
......@@ -30,3 +32,4 @@ class monkeypatch(object):
def __exit__(self, *args):
requests = self._get_global_requests_module()
requests.get = self.orig_requests_get
requests.request = self.orig_requests_request
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment