diff options
author | Florian Bruhin <me@the-compiler.org> | 2019-11-18 19:05:19 +0100 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2019-11-18 19:21:06 +0100 |
commit | 4dba318adbaf39205f5e0c163deecea40331ea41 (patch) | |
tree | d853c97e38c7d6207508cf0132be47d6e980e320 /tests/unit/utils | |
parent | 9a95fe729f6557a30caba63b68bc95c4cecabcd8 (diff) | |
download | qutebrowser-4dba318adbaf39205f5e0c163deecea40331ea41.tar.gz qutebrowser-4dba318adbaf39205f5e0c163deecea40331ea41.zip |
Fix remaining implicit int issues with QtWebKit
See #4928
Diffstat (limited to 'tests/unit/utils')
-rw-r--r-- | tests/unit/utils/test_debug.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/unit/utils/test_debug.py b/tests/unit/utils/test_debug.py index 515da9a47..329a5a233 100644 --- a/tests/unit/utils/test_debug.py +++ b/tests/unit/utils/test_debug.py @@ -176,6 +176,26 @@ class TestQFlagsKey: flags = debug.qflags_key(base, value, klass=klass) assert flags == expected + def test_find_flags(self): + """Test a weird TypeError we get from PyQt. + + In exactly this constellation (happening via the "Searching with + --reverse" BDD test), calling QMetaEnum::valueToKey without wrapping + the flags in int() causes a TypeError. + + No idea what's happening here exactly... + """ + QWebPage = pytest.importorskip("PyQt5.QtWebKitWidgets").QWebPage + + flags = QWebPage.FindWrapsAroundDocument + flags |= QWebPage.FindBackward + flags &= ~QWebPage.FindBackward + flags &= ~QWebPage.FindWrapsAroundDocument + + debug.qflags_key(QWebPage, + flags, + klass=QWebPage.FindFlag) + def test_add_base(self): """Test with add_base=True.""" flags = debug.qflags_key(Qt, Qt.AlignTop, add_base=True) |