diff options
Diffstat (limited to 'tests/unit/test_qt_machinery.py')
-rw-r--r-- | tests/unit/test_qt_machinery.py | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/unit/test_qt_machinery.py b/tests/unit/test_qt_machinery.py index 0875be7e4..c49a2850b 100644 --- a/tests/unit/test_qt_machinery.py +++ b/tests/unit/test_qt_machinery.py @@ -118,8 +118,8 @@ def test_selectioninfo_use_wrapper(): ), ( "Qt wrapper info:\n" - " PyQt5: ImportError: Python imploded\n" " PyQt6: success\n" + " PyQt5: ImportError: Python imploded\n" " -> selected: PyQt6 (via autoselect)" ), ), @@ -131,6 +131,19 @@ def test_selectioninfo_str(info: machinery.SelectionInfo, expected: str): assert info.to_html() == html.escape(expected).replace("\n", "<br>") +def test_selectioninfo_str_wrapper_precedence(): + """The order of the wrappers should be the same as in machinery.WRAPPERS.""" + info = machinery.SelectionInfo( + wrapper="PyQt6", + reason=machinery.SelectionReason.auto, + pyqt5="ImportError: Python imploded", + pyqt6="success", + ) + lines = str(info).splitlines()[1:-1] + wrappers = [line.split(":")[0].strip() for line in lines] + assert wrappers == machinery.WRAPPERS + + @pytest.fixture def modules(): """Return a dict of modules to import-patch, all unavailable by default.""" @@ -355,8 +368,8 @@ class TestInit: "No Qt wrapper was importable.", "", "Qt wrapper info:", - " PyQt5: not imported", " PyQt6: ImportError: Fake ImportError for PyQt6.", + " PyQt5: not imported", " -> selected: None (via autoselect)", ] |