Source: python-mock Version: 4.0.3-2 Severity: serious Justification: FTBFS Tags: bookworm sid ftbfs User: lu...@debian.org Usertags: ftbfs-20211220 ftbfs-bookworm
Hi, During a rebuild of all packages in sid, your package failed to build on amd64. Relevant part (hopefully): > debian/rules binary > dh binary --with python3,sphinxdoc --buildsystem=pybuild > dh_update_autotools_config -O--buildsystem=pybuild > dh_autoreconf -O--buildsystem=pybuild > dh_auto_configure -O--buildsystem=pybuild > I: pybuild base:237: python3.10 setup.py config > /usr/lib/python3/dist-packages/setuptools/dist.py:723: UserWarning: Usage of > dash-separated 'home-page' will not be supported in future versions. Please > use the underscore name 'home_page' instead > warnings.warn( > /usr/lib/python3/dist-packages/setuptools/dist.py:723: UserWarning: Usage of > dash-separated 'description-file' will not be supported in future versions. > Please use the underscore name 'description_file' instead > warnings.warn( > /usr/lib/python3/dist-packages/setuptools/dist.py:723: UserWarning: Usage of > dash-separated 'author-email' will not be supported in future versions. > Please use the underscore name 'author_email' instead > warnings.warn( > running config > I: pybuild base:237: python3.9 setup.py config > /usr/lib/python3/dist-packages/setuptools/dist.py:723: UserWarning: Usage of > dash-separated 'home-page' will not be supported in future versions. Please > use the underscore name 'home_page' instead > warnings.warn( > /usr/lib/python3/dist-packages/setuptools/dist.py:723: UserWarning: Usage of > dash-separated 'description-file' will not be supported in future versions. > Please use the underscore name 'description_file' instead > warnings.warn( > /usr/lib/python3/dist-packages/setuptools/dist.py:723: UserWarning: Usage of > dash-separated 'author-email' will not be supported in future versions. > Please use the underscore name 'author_email' instead > warnings.warn( > running config > dh_auto_build -O--buildsystem=pybuild > I: pybuild base:237: /usr/bin/python3.10 setup.py build > /usr/lib/python3/dist-packages/setuptools/dist.py:723: UserWarning: Usage of > dash-separated 'home-page' will not be supported in future versions. Please > use the underscore name 'home_page' instead > warnings.warn( > /usr/lib/python3/dist-packages/setuptools/dist.py:723: UserWarning: Usage of > dash-separated 'description-file' will not be supported in future versions. > Please use the underscore name 'description_file' instead > warnings.warn( > /usr/lib/python3/dist-packages/setuptools/dist.py:723: UserWarning: Usage of > dash-separated 'author-email' will not be supported in future versions. > Please use the underscore name 'author_email' instead > warnings.warn( > running build > running build_py > creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_mock/build/mock > copying mock/__init__.py -> > /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_mock/build/mock > copying mock/mock.py -> > /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_mock/build/mock > copying mock/backports.py -> > /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_mock/build/mock > creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_mock/build/mock/tests > copying mock/tests/__init__.py -> > /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_mock/build/mock/tests > copying mock/tests/testasync.py -> > /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_mock/build/mock/tests > copying mock/tests/testsealable.py -> > /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_mock/build/mock/tests > copying mock/tests/testpatch.py -> > /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_mock/build/mock/tests > copying mock/tests/testmagicmethods.py -> > /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_mock/build/mock/tests > copying mock/tests/testsentinel.py -> > /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_mock/build/mock/tests > copying mock/tests/testcallable.py -> > /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_mock/build/mock/tests > copying mock/tests/testwith.py -> > /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_mock/build/mock/tests > copying mock/tests/support.py -> > /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_mock/build/mock/tests > copying mock/tests/testhelpers.py -> > /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_mock/build/mock/tests > copying mock/tests/testmock.py -> > /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_mock/build/mock/tests > I: pybuild base:237: /usr/bin/python3 setup.py build > /usr/lib/python3/dist-packages/setuptools/dist.py:723: UserWarning: Usage of > dash-separated 'home-page' will not be supported in future versions. Please > use the underscore name 'home_page' instead > warnings.warn( > /usr/lib/python3/dist-packages/setuptools/dist.py:723: UserWarning: Usage of > dash-separated 'description-file' will not be supported in future versions. > Please use the underscore name 'description_file' instead > warnings.warn( > /usr/lib/python3/dist-packages/setuptools/dist.py:723: UserWarning: Usage of > dash-separated 'author-email' will not be supported in future versions. > Please use the underscore name 'author_email' instead > warnings.warn( > running build > running build_py > creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_mock/build/mock > copying mock/__init__.py -> > /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_mock/build/mock > copying mock/mock.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_mock/build/mock > copying mock/backports.py -> > /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_mock/build/mock > creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_mock/build/mock/tests > copying mock/tests/__init__.py -> > /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_mock/build/mock/tests > copying mock/tests/testasync.py -> > /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_mock/build/mock/tests > copying mock/tests/testsealable.py -> > /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_mock/build/mock/tests > copying mock/tests/testpatch.py -> > /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_mock/build/mock/tests > copying mock/tests/testmagicmethods.py -> > /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_mock/build/mock/tests > copying mock/tests/testsentinel.py -> > /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_mock/build/mock/tests > copying mock/tests/testcallable.py -> > /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_mock/build/mock/tests > copying mock/tests/testwith.py -> > /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_mock/build/mock/tests > copying mock/tests/support.py -> > /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_mock/build/mock/tests > copying mock/tests/testhelpers.py -> > /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_mock/build/mock/tests > copying mock/tests/testmock.py -> > /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_mock/build/mock/tests > dh_auto_test -O--buildsystem=pybuild > I: pybuild base:237: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_mock/build; > python3.10 -m pytest --pyargs mock.tests > ============================= test session starts > ============================== > platform linux -- Python 3.10.1, pytest-6.2.5, py-1.10.0, pluggy-0.13.0 > rootdir: /<<PKGBUILDDIR>>, configfile: setup.cfg > collected 494 items > > mock/tests/testasync.py ................................................ [ > 9%] > ................................... [ > 16%] > mock/tests/testcallable.py ........... [ > 19%] > mock/tests/testhelpers.py .............................................. [ > 28%] > ............................ [ > 34%] > mock/tests/testmagicmethods.py .................................. [ > 40%] > mock/tests/testmock.py ........................................F........ [ > 50%] > ........................................................................ [ > 65%] > ............ [ > 67%] > mock/tests/testpatch.py ................................................ [ > 77%] > ............................................................ [ > 89%] > mock/tests/testsealable.py .................. [ > 93%] > mock/tests/testsentinel.py ...... [ > 94%] > mock/tests/testwith.py ........................... > [100%] > > =================================== FAILURES > =================================== > _____________ MockTest.test_bool_not_called_when_passing_spec_arg > ______________ > > self = <mock.tests.testmock.MockTest > testMethod=test_bool_not_called_when_passing_spec_arg> > > def test_bool_not_called_when_passing_spec_arg(self): > class Something: > def __init__(self): > self.obj_with_bool_func = unittest.mock.MagicMock() > > obj = Something() > > with unittest.mock.patch.object(obj, 'obj_with_bool_func', > > autospec=True): pass > > mock/tests/testmock.py:2176: > _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > _ > > self = <unittest.mock._patch object at 0x7f741ff6bbb0> > > def __enter__(self): > """Perform the patch.""" > new, spec, spec_set = self.new, self.spec, self.spec_set > autospec, kwargs = self.autospec, self.kwargs > new_callable = self.new_callable > self.target = self.getter() > > # normalise False to None > if spec is False: > spec = None > if spec_set is False: > spec_set = None > if autospec is False: > autospec = None > > if spec is not None and autospec is not None: > raise TypeError("Can't specify spec and autospec") > if ((spec is not None or autospec is not None) and > spec_set not in (True, None)): > raise TypeError("Can't provide explicit spec_set *and* spec or > autospec") > > original, local = self.get_original() > > if new is DEFAULT and autospec is None: > inherit = False > if spec is True: > # set spec to the object we are replacing > spec = original > if spec_set is True: > spec_set = original > spec = None > elif spec is not None: > if spec_set is True: > spec_set = spec > spec = None > elif spec_set is True: > spec_set = original > > if spec is not None or spec_set is not None: > if original is DEFAULT: > raise TypeError("Can't use 'spec' with create=True") > if isinstance(original, type): > # If we're patching out a class and there is a spec > inherit = True > if spec is None and _is_async_obj(original): > Klass = AsyncMock > else: > Klass = MagicMock > _kwargs = {} > if new_callable is not None: > Klass = new_callable > elif spec is not None or spec_set is not None: > this_spec = spec > if spec_set is not None: > this_spec = spec_set > if _is_list(this_spec): > not_callable = '__call__' not in this_spec > else: > not_callable = not callable(this_spec) > if _is_async_obj(this_spec): > Klass = AsyncMock > elif not_callable: > Klass = NonCallableMagicMock > > if spec is not None: > _kwargs['spec'] = spec > if spec_set is not None: > _kwargs['spec_set'] = spec_set > > # add a name to mocks > if (isinstance(Klass, type) and > issubclass(Klass, NonCallableMock) and self.attribute): > _kwargs['name'] = self.attribute > > _kwargs.update(kwargs) > new = Klass(**_kwargs) > > if inherit and _is_instance_mock(new): > # we can only tell if the instance should be callable if the > # spec is not a list > this_spec = spec > if spec_set is not None: > this_spec = spec_set > if (not _is_list(this_spec) and not > _instance_callable(this_spec)): > Klass = NonCallableMagicMock > > _kwargs.pop('name') > new.return_value = Klass(_new_parent=new, _new_name='()', > **_kwargs) > elif autospec is not None: > # spec is ignored, new *must* be default, spec_set is treated > # as a boolean. Should we check spec is not None and that spec_set > # is a bool? > if new is not DEFAULT: > raise TypeError( > "autospec creates the mock for you. Can't specify " > "autospec and new." > ) > if original is DEFAULT: > raise TypeError("Can't use 'autospec' with create=True") > spec_set = bool(spec_set) > if autospec is True: > autospec = original > > if _is_instance_mock(self.target): > raise InvalidSpecError( > f'Cannot autospec attr {self.attribute!r} as the patch ' > f'target has already been mocked out. ' > f'[target={self.target!r}, attr={autospec!r}]') > if _is_instance_mock(autospec): > target_name = getattr(self.target, '__name__', self.target) > > raise InvalidSpecError( > f'Cannot autospec attr {self.attribute!r} from target ' > f'{target_name!r} as it has already been mocked out. ' > f'[target={self.target!r}, attr={autospec!r}]') > E unittest.mock.InvalidSpecError: Cannot autospec attr > 'obj_with_bool_func' from target > <mock.tests.testmock.MockTest.test_bool_not_called_when_passing_spec_arg.<locals>.Something > object at 0x7f741fdde2f0> as it has already been mocked out. > [target=<mock.tests.testmock.MockTest.test_bool_not_called_when_passing_spec_arg.<locals>.Something > object at 0x7f741fdde2f0>, attr=<MagicMock id='140136727569088'>] > > /usr/lib/python3.10/unittest/mock.py:1528: InvalidSpecError > =========================== short test summary info > ============================ > FAILED > mock/tests/testmock.py::MockTest::test_bool_not_called_when_passing_spec_arg > ======================== 1 failed, 493 passed in 1.51s > ========================= > E: pybuild pybuild:355: test: plugin distutils failed with: exit code=1: cd > /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_mock/build; python3.10 -m pytest > --pyargs mock.tests > I: pybuild base:237: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9_mock/build; > python3.9 -m pytest --pyargs mock.tests > ============================= test session starts > ============================== > platform linux -- Python 3.9.9, pytest-6.2.5, py-1.10.0, pluggy-0.13.0 > rootdir: /<<PKGBUILDDIR>>, configfile: setup.cfg > collected 494 items > > mock/tests/testasync.py ................................................ [ > 9%] > ................................... [ > 16%] > mock/tests/testcallable.py ........... [ > 19%] > mock/tests/testhelpers.py .............................................. [ > 28%] > ............................ [ > 34%] > mock/tests/testmagicmethods.py .................................. [ > 40%] > mock/tests/testmock.py ................................................. [ > 50%] > ........................................................................ [ > 65%] > ............ [ > 67%] > mock/tests/testpatch.py ................................................ [ > 77%] > ............................................................ [ > 89%] > mock/tests/testsealable.py .................. [ > 93%] > mock/tests/testsentinel.py ...... [ > 94%] > mock/tests/testwith.py ........................... > [100%] > > ============================= 494 passed in 1.47s > ============================== > dh_auto_test: error: pybuild --test --test-pytest -i python{version} -p "3.10 > 3.9" returned exit code 13 The full build log is available from: http://qa-logs.debian.net/2021/12/20/python-mock_4.0.3-2_unstable.log A list of current common problems and possible solutions is available at http://wiki.debian.org/qa.debian.org/FTBFS . You're welcome to contribute! If you reassign this bug to another package, please marking it as 'affects'-ing this package. See https://www.debian.org/Bugs/server-control#affects If you fail to reproduce this, please provide a build log and diff it with mine so that we can identify if something relevant changed in the meantime.