Skip to content

Commit 3da8630

Browse files
authored
Check if PySide2 supports flag OR-ing for xfail (#497)
Seems to be fixed somewhere between: - PySide2 5.15.2.1 (latest version on PyPI) - PySide2 5.15.10 (version I have installed via Archlinux) But no idea where exactly, so let's just try it out at import time. See #419 (comment)
1 parent 3e593f2 commit 3da8630

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tests/test_modeltest.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,19 @@ def data(
113113
check_model(BrokenTypeModel(), should_pass=False)
114114

115115

116+
def check_broken_flag_or():
117+
flag = qt_api.QtCore.Qt.AlignmentFlag
118+
try:
119+
int(flag.AlignHorizontal_Mask | flag.AlignVertical_Mask)
120+
except SystemError:
121+
# Should not be happening anywhere else
122+
assert sys.version_info[:2] == (3, 11) and qt_api.pytest_qt_api == "pyside2"
123+
return True
124+
return False
125+
126+
116127
xfail_py311_pyside2 = pytest.mark.xfail(
117-
sys.version_info[:2] == (3, 11) and qt_api.pytest_qt_api == "pyside2",
128+
check_broken_flag_or(),
118129
reason="Fails to OR mask flags",
119130
)
120131

0 commit comments

Comments
 (0)