Skip to content

Commit

Permalink
Check if PySide2 supports flag OR-ing for xfail
Browse files Browse the repository at this point in the history
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 pytest-dev#419 (comment)
  • Loading branch information
The-Compiler committed Jun 26, 2023
1 parent f166fa7 commit b97b4a4
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/test_modeltest.py
Expand Up @@ -113,8 +113,19 @@ def data(
check_model(BrokenTypeModel(), should_pass=False)


def check_broken_flag_or():
flag = qt_api.QtCore.Qt.AlignmentFlag
try:
int(flag.AlignHorizontal_Mask | flag.AlignVertical_Mask)
except SystemError:
# Should not be happening anywhere else
assert sys.version_info[:2] == (3, 11) and qt_api.pytest_qt_api == "pyside2"
return True
return False


xfail_py311_pyside2 = pytest.mark.xfail(
sys.version_info[:2] == (3, 11) and qt_api.pytest_qt_api == "pyside2",
check_broken_flag_or(),
reason="Fails to OR mask flags",
)

Expand Down

0 comments on commit b97b4a4

Please sign in to comment.