Package: src:python-qrcode
Version: 7.4.2-3
Severity: important
Tags: sid trixie
User: [email protected]
Usertags: python3.12
python-qrcode's autopkg tests fail with Python 3.12:
[...]
309s autopkgtest [18:50:26]: test qrcode: [-----------------------
309s ============================= test session starts
==============================
309s platform linux -- Python 3.12.0+, pytest-7.4.3, pluggy-1.3.0
309s rootdir: /tmp/autopkgtest.A3lFBV/autopkgtest_tmp
309s collected 79 items
309s
309s tests/test_example.py .
[ 1%]
312s tests/test_qrcode.py
................................................... [ 65%]
312s ...
[ 69%]
312s tests/test_qrcode_svg.py ......
[ 77%]
312s tests/test_release.py F...
[ 82%]
312s tests/test_script.py .............
[ 98%]
312s tests/test_util.py .
[100%]
312s
312s =================================== FAILURES
===================================
312s ________________________ UpdateManpageTests.test_change
________________________
312s
312s self = <tests.test_release.UpdateManpageTests testMethod=test_change>
312s mock_file = <MagicMock name='open' id='139709509974016'>
312s
312s @mock.patch(OPEN, new_callable=mock.mock_open, read_data=DATA)
312s def test_change(self, mock_file):
312s update_manpage({"name": "qrcode", "new_version": "3.11"})
312s expected = re.split(r"([^\n]*(?:\n|$))", DATA)[1::2]
312s expected[1] = (
312s expected[1]
312s .replace("version", "3.11")
312s .replace("date", datetime.datetime.now().strftime("%-d
%b %Y"))
312s )
312s > mock_file().write.has_calls([mock.call(line) for line in
expected])
312s
312s tests/test_release.py:40:
312s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _
312s
312s self = <MagicMock name='open().write' id='139709510532992'>, name =
'has_calls'
312s
312s def __getattr__(self, name):
312s if name in {'_mock_methods', '_mock_unsafe'}:
312s raise AttributeError(name)
312s elif self._mock_methods is not None:
312s if name not in self._mock_methods or name in _all_magics:
312s raise AttributeError("Mock object has no attribute
%r" % name)
312s elif _is_magic(name):
312s raise AttributeError(name)
312s if not self._mock_unsafe and (not self._mock_methods or
name not in self._mock_methods):
312s if name.startswith(('assert', 'assret', 'asert',
'aseert', 'assrt')) or name in _ATTRIB_DENY_LIST:
312s > raise AttributeError(
312s f"{name!r} is not a valid assertion. Use a spec "
312s f"for the mock if {name!r} is meant to be an
attribute.")
312s E AttributeError: 'has_calls' is not a valid
assertion. Use a spec for the mock if 'has_calls' is meant to be an
attribute.
312s
312s /usr/lib/python3.12/unittest/mock.py:663: AttributeError
312s =============================== warnings summary
===============================
312s tests/test_script.py::ScriptTest::test_bad_factory
312s /usr/lib/python3/dist-packages/qrcode/console_scripts.py:43:
DeprecationWarning: pkg_resources is deprecated as an API. See
https://setuptools.pypa.io/en/latest/pkg_resources.html
312s from pkg_resources import get_distribution
312s
312s -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
312s =========================== short test summary info
============================
312s FAILED tests/test_release.py::UpdateManpageTests::test_change -
AttributeErro...
312s =================== 1 failed, 78 passed, 1 warning in 3.34s
====================