File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 55from pytestqt .exceptions import capture_exceptions , format_captured_exceptions
66from pytestqt .qt_compat import qt_api
77
8+
9+ def has_pyside6_exception_capture ():
10+ return qt_api .pytest_qt_api == "pyside6" and tuple (
11+ int (part ) for part in qt_api .get_versions ().qt_api_version .split ("." )
12+ ) >= (6 , 5 , 2 )
13+
14+
815# PySide6 is automatically captures exceptions during the event loop,
916# and re-raises them when control gets back to Python, so the related
1017# functionality does not work, nor is needed for the end user.
1118exception_capture_pyside6 = pytest .mark .skipif (
12- qt_api . pytest_qt_api == "pyside6" ,
19+ has_pyside6_exception_capture () ,
1320 reason = "pytest-qt capture not working/needed on PySide6" ,
1421)
1522
@@ -51,7 +58,7 @@ def test_exceptions(qtbot):
5158 )
5259 result = testdir .runpytest ()
5360 if raise_error :
54- if qt_api . pytest_qt_api == "pyside6" :
61+ if has_pyside6_exception_capture () :
5562 # PySide6 automatically captures exceptions during the event loop,
5663 # and re-raises them when control gets back to Python.
5764 # This results in the exception not being captured by
You can’t perform that action at this time.
0 commit comments