Closed
Description
The test now fails due to psf/requests@26bea1e.
_________ TestReleaseConnection.test_not_modified_releases_connection __________
self = <test_etag.TestReleaseConnection object at 0x7fffe4440d90>
server = <cherrypy._cpserver.Server object at 0x7ffff5de7910>
url = 'http://127.0.0.1:40527/'
def test_not_modified_releases_connection(self, server, url):
sess = CacheControl(requests.Session())
etag_url = urljoin(url, "/etag")
sess.get(etag_url)
resp = Mock(status=304, headers={})
# This is how the urllib3 response is created in
# requests.adapters
response_mod = "requests.adapters.HTTPResponse.from_httplib"
> with patch(response_mod, Mock(return_value=resp)):
tests/test_etag.py:151:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/nix/store/iv4k48zk6fqjq6qm00b9qfwflb9wsh12-python3.10-mock-4.0.3/lib/python3.10/site-packages/mock/mock.py:1398: in __enter__
self.target = self.getter()
/nix/store/iv4k48zk6fqjq6qm00b9qfwflb9wsh12-python3.10-mock-4.0.3/lib/python3.10/site-packages/mock/mock.py:1573: in <lambda>
getter = lambda: _importer(target)
/nix/store/iv4k48zk6fqjq6qm00b9qfwflb9wsh12-python3.10-mock-4.0.3/lib/python3.10/site-packages/mock/mock.py:1249: in _importer
thing = _dot_lookup(thing, comp, import_path)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
thing = <module 'requests.adapters' from '/nix/store/27vh1wp127b0aw7k1yxq3bpvamx97zj6-python3.10-requests-2.29.0/lib/python3.10/site-packages/requests/adapters.py'>
comp = 'HTTPResponse', import_path = 'requests.adapters.HTTPResponse'
def _dot_lookup(thing, comp, import_path):
try:
return getattr(thing, comp)
except AttributeError:
> __import__(import_path)
E ModuleNotFoundError: No module named 'requests.adapters.HTTPResponse'; 'requests.adapters' is not a package
/nix/store/iv4k48zk6fqjq6qm00b9qfwflb9wsh12-python3.10-mock-4.0.3/lib/python3.10/site-packages/mock/mock.py:1238: ModuleNotFoundError
Metadata
Metadata
Assignees
Labels
No labels