summaryrefslogtreecommitdiff
path: root/tests/unit
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2023-06-13 19:56:21 +0200
committerFlorian Bruhin <me@the-compiler.org>2023-06-13 19:56:21 +0200
commitca4cd3a24ff7bdb2e2fa18e0905e90c673222185 (patch)
tree56c6fb8e676d5b23fb0ed2fd5a390ec718361079 /tests/unit
parent92243041c24b23178d4d0c860d52bc442490d291 (diff)
downloadqutebrowser-ca4cd3a24ff7bdb2e2fa18e0905e90c673222185.tar.gz
qutebrowser-ca4cd3a24ff7bdb2e2fa18e0905e90c673222185.zip
qt: Refactor SelectionInfo.set_module_error
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/test_qt_machinery.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/unit/test_qt_machinery.py b/tests/unit/test_qt_machinery.py
index ed1e53aa7..386081f5d 100644
--- a/tests/unit/test_qt_machinery.py
+++ b/tests/unit/test_qt_machinery.py
@@ -68,9 +68,9 @@ def test_importerror_exceptions(exception: Exception):
raise exception
-def test_selectioninfo_set_module():
+def test_selectioninfo_set_module_error():
info = machinery.SelectionInfo()
- info.set_module("PyQt5", "ImportError: Python imploded")
+ info.set_module_error("PyQt5", ImportError("Python imploded"))
assert info == machinery.SelectionInfo(
wrapper=None,
reason=machinery.SelectionReason.unknown,
@@ -79,6 +79,17 @@ def test_selectioninfo_set_module():
)
+def test_selectioninfo_use_wrapper():
+ info = machinery.SelectionInfo()
+ info.use_wrapper("PyQt6")
+ assert info == machinery.SelectionInfo(
+ wrapper="PyQt6",
+ reason=machinery.SelectionReason.unknown,
+ pyqt5=None,
+ pyqt6="success",
+ )
+
+
@pytest.mark.parametrize(
"info, expected",
[