swh_storage = <swh.storage.validate.ValidatingProxyStorage object at 0x7f729c184ba8>
sample_data = {'authority': [{'metadata': {'location': 'France'}, 'type': 'deposit-client', 'url': 'http:///hal/inria'}], 'content':...384>, 'target': b'12345678901234567890', 'type': 'dir'}], 'id': b'4\x013B2S1\x000\xf51\xe62\xa73\xff7\xc3\xa90'}], ...}
mocker = <pytest_mock.plugin.MockFixture object at 0x7f729c184d30>
def test_retrying_proxy_swh_storage_tool_add_failure(swh_storage, sample_data, mocker):
"""Unfiltered errors are raising without retry
"""
> mock_memory = mocker.patch("swh.storage.in_memory.InMemoryStorage.tool_add")
.tox/py3/lib/python3.7/site-packages/swh/storage/tests/test_retry.py:397:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/pytest_mock/plugin.py:199: in __call__
return self._start_patch(self.mock_module.patch, *args, **kwargs)
.tox/py3/lib/python3.7/site-packages/pytest_mock/plugin.py:163: in _start_patch
mocked = p.start()
/usr/lib/python3.7/unittest/mock.py:1399: in start
result = self.__enter__()
/usr/lib/python3.7/unittest/mock.py:1268: in __enter__
original, local = self.get_original()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <unittest.mock._patch object at 0x7f729c184908>
def get_original(self):
target = self.getter()
name = self.attribute
original = DEFAULT
local = False
try:
original = target.__dict__[name]
except (AttributeError, KeyError):
original = getattr(target, name, DEFAULT)
else:
local = True
if name in _builtins and isinstance(target, ModuleType):
self.create = True
if not self.create and original is DEFAULT:
raise AttributeError(
> "%s does not have the attribute %r" % (target, name)
)
E AttributeError: <class 'swh.storage.in_memory.InMemoryStorage'> does not have the attribute 'tool_add'
/usr/lib/python3.7/unittest/mock.py:1242: AttributeError
TEST RESULT
TEST RESULT
- Run At
- Apr 9 2020, 12:48 PM