diff options
author | toofar <toofar@spalge.com> | 2023-07-30 11:02:56 +1200 |
---|---|---|
committer | toofar <toofar@spalge.com> | 2023-07-30 11:18:05 +1200 |
commit | ea6c84e04b60fcef06356b11612109015fbefe76 (patch) | |
tree | e9adb382a15e909719ff53e9329a72d3973419f0 | |
parent | 6cfe5bc9c9a3ca0ce3268b4785ef213c9d1485e5 (diff) | |
download | qutebrowser-ea6c84e04b60fcef06356b11612109015fbefe76.tar.gz qutebrowser-ea6c84e04b60fcef06356b11612109015fbefe76.zip |
Use full sip module for PyQt5 too.
It's a change from before but it's strictly more accurate anyway, in the
application we are always using sip from under the PyQt module, even if
PyQt5 registers it as the plain `sip` too. And now it's consistent with
what we have to do for PyQt6.
-rw-r--r-- | qutebrowser/utils/version.py | 2 | ||||
-rw-r--r-- | tests/unit/utils/test_version.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/qutebrowser/utils/version.py b/qutebrowser/utils/version.py index 65fca21f7..ce816b9fd 100644 --- a/qutebrowser/utils/version.py +++ b/qutebrowser/utils/version.py @@ -391,10 +391,10 @@ def _create_module_info() -> Dict[str, ModuleInfo]: if machinery.IS_QT5: packages += [ - ('sip', ['SIP_VERSION_STR']), ('PyQt5.QtWebEngineWidgets', []), ('PyQt5.QtWebEngine', ['PYQT_WEBENGINE_VERSION_STR']), ('PyQt5.QtWebKitWidgets', []), + ('PyQt5.sip', ['SIP_VERSION_STR']), ] elif machinery.IS_QT6: packages += [ diff --git a/tests/unit/utils/test_version.py b/tests/unit/utils/test_version.py index ce3912595..486270d70 100644 --- a/tests/unit/utils/test_version.py +++ b/tests/unit/utils/test_version.py @@ -697,7 +697,7 @@ class TestModuleVersions: @pytest.mark.parametrize('attribute, expected_modules', [ ('VERSION', ['colorama']), - ('SIP_VERSION_STR', ['sip']), + ('SIP_VERSION_STR', ['PyQt5.sip', 'PyQt6.sip']), (None, []), ]) def test_version_attribute(self, attribute, expected_modules, import_fake): @@ -720,7 +720,7 @@ class TestModuleVersions: expected = [] for name in import_fake.modules: mod_info = version.MODULE_INFO[name] - if name in expected_modules or ("sip" in expected_modules and name == "PyQt6.sip"): + if name in expected_modules: assert mod_info.get_version() == "1.2.3" expected.append('{}: 1.2.3'.format(name)) else: |