Merge pull request #2994 from Stranger6667/fix-bad-test

Fixed test execution.
This commit is contained in:
Cory Benfield
2016-02-03 20:53:08 +00:00
2 changed files with 4 additions and 3 deletions
-1
View File
@@ -1,7 +1,6 @@
#!/usr/bin/env python
import os
import platform
import re
import sys
+4 -2
View File
@@ -606,11 +606,13 @@ class TestRequests:
def test_hook_receives_request_arguments(self, httpbin):
def hook(resp, **kwargs):
# FIXME. Not executed
assert resp is not None
assert kwargs != {}
requests.Request('GET', httpbin(), hooks={'response': hook})
s = requests.Session()
r = requests.Request('GET', httpbin(), hooks={'response': hook})
prep = s.prepare_request(r)
s.send(prep)
def test_session_hooks_are_used_with_no_request_hooks(self, httpbin):
hook = lambda x, *args, **kwargs: x