Edit: I realize this may have nothing to do with requests-toolbelt, it's just the only lead I have at the moment.
This is an odd issue that I just discovered with PRAW's testing suite as travis recently started failing almost all requests. I have narrowed the issue down to it failing only when .eggs/requests_toolbelt-0.4.0-py3.4.egg
does not previously exist. On subsequent runs, when that file already exists, the tests pass just fine.
Below is a sample run starting with (1) it working, (2) removing the egg and observing the failure, (3) running again and seeing the success:
(tmp)bboe@spock:praw (updates)$ python setup.py test -s tests.test_wiki_page.WikiPageTests.test_revision_by
running test
Searching for mock>=1.0.0
Best match: mock 1.0.1
Processing mock-1.0.1-py3.4.egg
Using /Users/bboe/src/praw-dev/praw/.eggs/mock-1.0.1-py3.4.egg
Searching for betamax-matchers>=0.2.0
Best match: betamax-matchers 0.2.0
Processing betamax_matchers-0.2.0-py3.4.egg
Using /Users/bboe/src/praw-dev/praw/.eggs/betamax_matchers-0.2.0-py3.4.egg
Searching for betamax>=0.4.2
Best match: betamax 0.4.2
Processing betamax-0.4.2-py3.4.egg
Using /Users/bboe/src/praw-dev/praw/.eggs/betamax-0.4.2-py3.4.egg
Searching for requests-toolbelt>=0.4.0
Best match: requests-toolbelt 0.4.0
Processing requests_toolbelt-0.4.0-py3.4.egg
Using /Users/bboe/src/praw-dev/praw/.eggs/requests_toolbelt-0.4.0-py3.4.egg
running egg_info
writing entry points to praw.egg-info/entry_points.txt
writing dependency_links to praw.egg-info/dependency_links.txt
writing requirements to praw.egg-info/requires.txt
writing praw.egg-info/PKG-INFO
writing top-level names to praw.egg-info/top_level.txt
reading manifest file 'praw.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*' under directory 'praw/tests/files'
writing manifest file 'praw.egg-info/SOURCES.txt'
running build_ext
test_revision_by (tests.test_wiki_page.WikiPageTests) ... ok
----------------------------------------------------------------------
Ran 1 test in 0.009s
OK
(tmp)bboe@spock:praw (updates)$ rm .eggs/requests_toolbelt-0.4.0-py3.4.egg
(tmp)bboe@spock:praw (updates)$ python setup.py test -s tests.test_wiki_page.WikiPageTests.test_revision_by
running test
Searching for mock>=1.0.0
Best match: mock 1.0.1
Processing mock-1.0.1-py3.4.egg
Using /Users/bboe/src/praw-dev/praw/.eggs/mock-1.0.1-py3.4.egg
Searching for betamax-matchers>=0.2.0
Best match: betamax-matchers 0.2.0
Processing betamax_matchers-0.2.0-py3.4.egg
Using /Users/bboe/src/praw-dev/praw/.eggs/betamax_matchers-0.2.0-py3.4.egg
Searching for betamax>=0.4.2
Best match: betamax 0.4.2
Processing betamax-0.4.2-py3.4.egg
Using /Users/bboe/src/praw-dev/praw/.eggs/betamax-0.4.2-py3.4.egg
Searching for requests-toolbelt>=0.4.0
Reading https://pypi.python.org/simple/requests-toolbelt/
Best match: requests-toolbelt 0.4.0
Downloading https://pypi.python.org/packages/source/r/requests-toolbelt/requests-toolbelt-0.4.0.tar.gz#md5=2278d650faadf181dd180682591e5926
Processing requests-toolbelt-0.4.0.tar.gz
Writing /var/folders/zq/1jxg9xbx211_syhlv6cl2jq40000gn/T/easy_install-kowpbdbs/requests-toolbelt-0.4.0/setup.cfg
Running requests-toolbelt-0.4.0/setup.py -q bdist_egg --dist-dir /var/folders/zq/1jxg9xbx211_syhlv6cl2jq40000gn/T/easy_install-kowpbdbs/requests-toolbelt-0.4.0/egg-dist-tmp-avhtypx4
no previously-included directories found matching '*.pyc'
warning: manifest_maker: MANIFEST.in, line 6: 'recursive-include' expects <dir> <pattern1> <pattern2> ...
warning: manifest_maker: MANIFEST.in, line 7: 'recursive-include' expects <dir> <pattern1> <pattern2> ...
no previously-included directories found matching 'docs/_build'
zip_safe flag not set; analyzing archive contents...
Copying requests_toolbelt-0.4.0-py3.4.egg to /Users/bboe/src/praw-dev/praw/.eggs
Installed /Users/bboe/src/praw-dev/praw/.eggs/requests_toolbelt-0.4.0-py3.4.egg
running egg_info
writing top-level names to praw.egg-info/top_level.txt
writing requirements to praw.egg-info/requires.txt
writing entry points to praw.egg-info/entry_points.txt
writing dependency_links to praw.egg-info/dependency_links.txt
writing praw.egg-info/PKG-INFO
reading manifest file 'praw.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*' under directory 'praw/tests/files'
writing manifest file 'praw.egg-info/SOURCES.txt'
running build_ext
test_revision_by (tests.test_wiki_page.WikiPageTests) ... ERROR
======================================================================
ERROR: test_revision_by (tests.test_wiki_page.WikiPageTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/bboe/src/praw-dev/praw/tests/helper.py", line 120, in betamax_function
return function(obj)
File "/Users/bboe/src/praw-dev/praw/tests/test_wiki_page.py", line 64, in test_revision_by
self.subreddit.get_wiki_pages()))
File "/Users/bboe/src/praw-dev/praw/praw/decorators.py", line 60, in wrapped
return function(self.reddit_session, self, *args, **kwargs)
File "/Users/bboe/src/praw-dev/praw/praw/decorators.py", line 345, in wrapped
return function(cls, *args, **kwargs)
File "/Users/bboe/src/praw-dev/praw/praw/__init__.py", line 1052, in get_wiki_pages
six.text_type(subreddit))
File "/Users/bboe/src/praw-dev/praw/praw/decorators.py", line 170, in wrapped
return_value = function(reddit_session, *args, **kwargs)
File "/Users/bboe/src/praw-dev/praw/praw/__init__.py", line 569, in request_json
retry_on_error=retry_on_error)
File "/Users/bboe/src/praw-dev/praw/praw/__init__.py", line 413, in _request
response = handle_redirect()
File "/Users/bboe/src/praw-dev/praw/praw/__init__.py", line 383, in handle_redirect
timeout=timeout, **kwargs)
File "/Users/bboe/src/praw-dev/praw/praw/handlers.py", line 138, in wrapped
if _cache_key in cls.cache:
TypeError: unhashable type: 'RequestsCookieJar'
----------------------------------------------------------------------
Ran 1 test in 0.007s
FAILED (errors=1)
(tmp)bboe@spock:praw (updates)$ python setup.py test -s tests.test_wiki_page.WikiPageTests.test_revision_by
running test
Searching for mock>=1.0.0
Best match: mock 1.0.1
Processing mock-1.0.1-py3.4.egg
Using /Users/bboe/src/praw-dev/praw/.eggs/mock-1.0.1-py3.4.egg
Searching for betamax-matchers>=0.2.0
Best match: betamax-matchers 0.2.0
Processing betamax_matchers-0.2.0-py3.4.egg
Using /Users/bboe/src/praw-dev/praw/.eggs/betamax_matchers-0.2.0-py3.4.egg
Searching for betamax>=0.4.2
Best match: betamax 0.4.2
Processing betamax-0.4.2-py3.4.egg
Using /Users/bboe/src/praw-dev/praw/.eggs/betamax-0.4.2-py3.4.egg
Searching for requests-toolbelt>=0.4.0
Best match: requests-toolbelt 0.4.0
Processing requests_toolbelt-0.4.0-py3.4.egg
Using /Users/bboe/src/praw-dev/praw/.eggs/requests_toolbelt-0.4.0-py3.4.egg
running egg_info
writing requirements to praw.egg-info/requires.txt
writing entry points to praw.egg-info/entry_points.txt
writing dependency_links to praw.egg-info/dependency_links.txt
writing top-level names to praw.egg-info/top_level.txt
writing praw.egg-info/PKG-INFO
reading manifest file 'praw.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*' under directory 'praw/tests/files'
writing manifest file 'praw.egg-info/SOURCES.txt'
running build_ext
test_revision_by (tests.test_wiki_page.WikiPageTests) ... ok
----------------------------------------------------------------------
Ran 1 test in 0.009s
OK
I really have no idea what to make of this at the moment. Any thoughts? Thanks!