patrys / httmock

A mocking library for requests
Other
466 stars 57 forks source link

requests.Session.prepare_request require requests > 2.0 #32

Open k4ml opened 9 years ago

k4ml commented 9 years ago

The latest version - https://github.com/patrys/httmock/blob/master/httmock.py#L109

When running with requests-1.2.0, got the following:-

Traceback (most recent call last):
  File "/home/kamal/clean/marimore_m7msgezsms/branches/219-private-routing-ordered/src/m7msgezsms/apps/ezsms_api_test/tests/tests_call_api.py", line 376, in test_valid_update_call_status
    with httmock.HTTMock(_get_response):
  File "/home/kamal/clean/marimore_m7msgezsms/branches/219-private-routing-ordered/eggs/httmock-1.2.3-py2.7.egg/httmock.py", line 109, in __enter__
    self._real_session_prepare_request = requests.Session.prepare_request
AttributeError: type object 'Session' has no attribute 'prepare_request'

setup.py should be updated to require requests>=2.0.

Reference - https://github.com/kennethreitz/requests/blob/master/HISTORY.rst#200-2013-09-24