diff --git a/qutebrowser/utils/debug.py b/qutebrowser/utils/debug.py index c82c488da..811598582 100644 --- a/qutebrowser/utils/debug.py +++ b/qutebrowser/utils/debug.py @@ -156,7 +156,7 @@ def qflags_key(base, value, add_base=False, klass=None): names = [] mask = 0x01 value = int(value) - while mask < value: + while mask <= value: if value & mask: bits.append(mask) mask <<= 1 diff --git a/tests/unit/utils/test_debug.py b/tests/unit/utils/test_debug.py index 093f801d9..da37e6b36 100644 --- a/tests/unit/utils/test_debug.py +++ b/tests/unit/utils/test_debug.py @@ -163,7 +163,7 @@ class TestQFlagsKey: fixme = pytest.mark.xfail(reason="See issue #42", raises=AssertionError) @pytest.mark.parametrize('base, value, klass, expected', [ - fixme((Qt, Qt.AlignTop, None, 'AlignTop')), + (Qt, Qt.AlignTop, None, 'AlignTop'), fixme((Qt, Qt.AlignLeft | Qt.AlignTop, None, 'AlignLeft|AlignTop')), (Qt, Qt.AlignCenter, None, 'AlignHCenter|AlignVCenter'), fixme((Qt, 0x0021, Qt.Alignment, 'AlignLeft|AlignTop')), @@ -173,7 +173,6 @@ class TestQFlagsKey: flags = debug.qflags_key(base, value, klass=klass) assert flags == expected - @fixme def test_add_base(self): """Test with add_base=True.""" flags = debug.qflags_key(Qt, Qt.AlignTop, add_base=True)