Skip to content

Instantly share code, notes, and snippets.

@mgood
Created September 25, 2013 00:25
Show Gist options
  • Save mgood/6693271 to your computer and use it in GitHub Desktop.
Save mgood/6693271 to your computer and use it in GitHub Desktop.
HTTPretty errors with requests 2.0
======================================================================
FAIL: HTTPretty should support rotating responses with requests
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/mgood/Projects/HTTPretty/.tox/py27/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/Users/mgood/Projects/HTTPretty/.tox/py27/lib/python2.7/site-packages/nose/util.py", line 622, in newfunc
return func(*arg, **kw)
File "/Users/mgood/Projects/HTTPretty/httpretty/core.py", line 829, in wrapper
return test(*args, **kw)
File "/Users/mgood/Projects/HTTPretty/.tox/py27/lib/python2.7/site-packages/sure/__init__.py", line 200, in wrap
raise AssertionError(exc.pop(0))
AssertionError: Traceback (most recent call last):
File "/Users/mgood/Projects/HTTPretty/.tox/py27/lib/python2.7/site-packages/sure/__init__.py", line 177, in wrap
func(start, *args, **kw)
File "/Users/mgood/Projects/HTTPretty/tests/functional/test_requests.py", line 183, in test_rotating_responses_with_requests
'https://api.yahoo.com/test')
File "/Users/mgood/Projects/HTTPretty/.tox/py27/lib/python2.7/site-packages/requests/api.py", line 55, in get
return request('get', url, **kwargs)
File "/Users/mgood/Projects/HTTPretty/.tox/py27/lib/python2.7/site-packages/requests/api.py", line 44, in request
return session.request(method=method, url=url, **kwargs)
File "/Users/mgood/Projects/HTTPretty/.tox/py27/lib/python2.7/site-packages/requests/sessions.py", line 330, in request
env_proxies = get_environ_proxies(url) or {}
File "/Users/mgood/Projects/HTTPretty/.tox/py27/lib/python2.7/site-packages/requests/utils.py", line 419, in get_environ_proxies
if proxy_bypass(netloc):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 1433, in proxy_bypass
return proxy_bypass_macosx_sysconf(host)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 1400, in proxy_bypass_macosx_sysconf
hostIP = ip2num(hostIP)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 1377, in ip2num
parts = map(int, parts)
ValueError: invalid literal for int() with base 10: 'api'
-------------------- >> begin captured stdout << ---------------------
(2130, 200000)
--------------------- >> end captured stdout << ----------------------
======================================================================
FAIL: Mock a streaming HTTP response, like those returned by the Twitter streaming
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment