[Python-apps-team] Bug#998297: mu-editor: FTBFS: AssertionError: Expected 'SendScintilla' to be called once. Called 0 times.

Andreas Beckmann anbe at debian.org
Mon Nov 1 22:42:35 GMT 2021


Source: mu-editor
Version: 1.1.0~alpha2+dfsg1-1
Severity: serious
Tags: ftbfs
Justification: fails to build from source

Hi,

mu-editor/experimental recently started to FTBFS:

=================================== FAILURES ===================================
_________________________ test_tidy_code_valid_python __________________________

    @pytest.mark.skipif(sys.version_info < (3, 6), reason="Requires Python3.6")
    def test_tidy_code_valid_python():
        """
        Ensure the "good case" works as expected (the code is reformatted and Mu
        shows a status message to confirm so).
        """
        mock_view = mock.MagicMock()
        mock_view.current_tab.text.return_value = "print('hello')"
        ed = mu.logic.Editor(mock_view)
        ed.show_status_message = mock.MagicMock()
        ed.tidy_code()
        tab = mock_view.current_tab
>       tab.SendScintilla.assert_called_once_with(tab.SCI_SETTEXT,
                                                  b'print("hello")\n')

tests/test_logic.py:3474: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <MagicMock name='mock.current_tab.SendScintilla' id='140677592560880'>
args = (<MagicMock name='mock.current_tab.SCI_SETTEXT' id='140677592488640'>, b'print("hello")\n')
kwargs = {}, msg = "Expected 'SendScintilla' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'SendScintilla' to be called once. Called 0 times.

/usr/lib/python3.9/unittest/mock.py:918: AssertionError
------------------------------ Captured log call -------------------------------
ERROR    mu.logic:logic.py:1508 cannot import name 'PY36_VERSIONS' from 'black' (/usr/lib/python3/dist-packages/black/__init__.py)
=============================== warnings summary ===============================
.pybuild/cpython3_3.9_mu-editor/build/tests/modes/test_microbit.py::test_flash_with_attached_known_device_and_forced
.pybuild/cpython3_3.9_mu-editor/build/tests/modes/test_microbit.py::test_flash_forced_with_attached_device_as_not_windows
.pybuild/cpython3_3.9_mu-editor/build/tests/modes/test_microbit.py::test_force_flash_user_specified_device_path
.pybuild/cpython3_3.9_mu-editor/build/tests/modes/test_microbit.py::test_force_flash_empty_script
.pybuild/cpython3_3.9_mu-editor/build/tests/modes/test_microbit.py::test_flash_force_with_attached_device_as_windows
.pybuild/cpython3_3.9_mu-editor/build/tests/modes/test_microbit.py::test_flash_device_has_latest_firmware_encounters_serial_problem_windows
.pybuild/cpython3_3.9_mu-editor/build/tests/modes/test_microbit.py::test_flash_with_attached_device_has_latest_firmware_encounters_problem
.pybuild/cpython3_3.9_mu-editor/build/tests/modes/test_microbit.py::test_flash_device_has_latest_firmware_encounters_serial_problem_unix
.pybuild/cpython3_3.9_mu-editor/build/tests/modes/test_microbit.py::test_flash_with_attached_device_has_latest_firmware
  /build/mu-editor-1.1.0~alpha2+dfsg1/.pybuild/cpython3_3.9_mu-editor/build/mu/modes/microbit.py:256: DeprecationWarning: Function 'semver.parse' is deprecated. Deprecated since version 2.10.0.  This function will be removed in semver 3. Use the respective 'semver.VersionInfo.parse' instead.
    semver.parse(version_info['release'])

.pybuild/cpython3_3.9_mu-editor/build/tests/modes/test_microbit.py: 10 warnings
  /build/mu-editor-1.1.0~alpha2+dfsg1/.pybuild/cpython3_3.9_mu-editor/build/mu/modes/microbit.py:272: DeprecationWarning: Function 'semver.compare' is deprecated. Deprecated since version 2.10.0.  This function will be removed in semver 3. Use the respective 'semver.VersionInfo.compare' instead.
    if semver.compare(board_version,

-- Docs: https://docs.pytest.org/en/stable/warnings.html
=========================== short test summary info ============================
FAILED tests/test_logic.py::test_tidy_code_valid_python - AssertionError: Exp...
================== 1 failed, 820 passed, 19 warnings in 6.51s ==================
E: pybuild pybuild:354: test: plugin distutils failed with: exit code=1: cd '/build/mu-editor-1.1.0~alpha2+dfsg1/.pybuild/cpython3_3.9_mu-editor/build'; python3.9 -m pytest --random-order
Traceback (most recent call last):
  File "/usr/bin/pybuild", line 352, in main
    run(func, i, version, c)
  File "/usr/bin/pybuild", line 302, in run
    result = func(context, args)
  File "/usr/share/dh-python/dhpython/build/base.py", line 282, in wrapped_func
    raise Exception(msg)
Exception: exit code=1: cd '/build/mu-editor-1.1.0~alpha2+dfsg1/.pybuild/cpython3_3.9_mu-editor/build'; python3.9 -m pytest --random-order
        rm -fr -- /tmp/dh-xdg-rundir-Uw9IX9A5
dh_auto_test: error: pybuild --test -i python{version} -p 3.9 returned exit code 13
make[1]: *** [debian/rules:42: override_dh_auto_test] Error 25


Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mu-editor_1.1.0~alpha2+dfsg1-1.log.gz
Type: application/gzip
Size: 28304 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/python-apps-team/attachments/20211101/e5b0bdb7/attachment-0001.gz>


More information about the Python-apps-team mailing list