mocker = <pytest_mock.plugin.MockerFixture object at 0x7f652e90f748>
datadir = '/var/lib/jenkins/workspace/DCORE/tests-on-diff@2/.tox/py3-core-db-server-slow-cover/lib/python3.7/site-packages/swh/core/db/tests/data'
@pytest.fixture()
def mock_package_sql(mocker, datadir):
"""This bypasses the module manipulation to only returns the data test files.
"""
from swh.core.utils import numfile_sortkey as sortkey
> mock_sql_files = mocker.patch("swh.core.cli.db.get_sql_for_package")
.tox/py3-core-db-server-slow-cover/lib/python3.7/site-packages/swh/core/db/tests/test_cli.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3-core-db-server-slow-cover/lib/python3.7/site-packages/pytest_mock/plugin.py:384: in __call__
**kwargs
.tox/py3-core-db-server-slow-cover/lib/python3.7/site-packages/pytest_mock/plugin.py:183: in _start_patch
mocked = p.start() # type: unittest.mock.MagicMock
/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 0x7f652e90f7f0>
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: <module 'swh.core.cli.db' from '/var/lib/jenkins/workspace/DCORE/tests-on-diff@2/.tox/py3-core-db-server-slow-cover/lib/python3.7/site-packages/swh/core/cli/db.py'> does not have the attribute 'get_sql_for_package'
/usr/lib/python3.7/unittest/mock.py:1242: AttributeError
TEST RESULT
TEST RESULT
- Run At
- Feb 2 2022, 1:51 PM