Skip to content

Allow QmlDependsTest to be run locally

Claudia Pellegrino requested to merge auerhuhn/namcap:fix-local-tests into master

!43 (merged) introduced QmlDependsTest, which fails locally if the host system happens to have the qt6-declarative package installed:

>       self.assertEqual(
            r.warnings,
            [("qml-module-no-package-associated %s %s", ("QtQuick.Window", "['usr/bin/main.qml']"))],
        )
E       AssertionError: Lists differ: [] != [('qml-module-no-package-associated %s %s'[41 chars]]"))]
E       
E       Second list contains 1 additional elements.
E       First extra element 0:
E       ('qml-module-no-package-associated %s %s', ('QtQuick.Window', "['usr/bin/main.qml']"))
E       
E       - []
E       + [('qml-module-no-package-associated %s %s',
E       +   ('QtQuick.Window', "['usr/bin/main.qml']"))]

Namcap/tests/package/test_qmldepends.py:36: AssertionError

This MR stubs out the qt6-declarative package from the local package database in order to make the test more robust and ensure it runs on any system, regardless of whether additional packages are installed.

/cc @arojas

/cc @alerque

Edited by Claudia Pellegrino

Merge request reports