File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 5
5
from pytestqt .exceptions import capture_exceptions , format_captured_exceptions
6
6
from pytestqt .qt_compat import qt_api
7
7
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
+
8
14
# PySide6 is automatically captures exceptions during the event loop,
9
15
# and re-raises them when control gets back to Python, so the related
10
16
# functionality does not work, nor is needed for the end user.
11
17
exception_capture_pyside6 = pytest .mark .skipif (
12
- qt_api . pytest_qt_api == "pyside6" ,
18
+ has_pyside6_exception_capture () ,
13
19
reason = "pytest-qt capture not working/needed on PySide6" ,
14
20
)
15
21
@@ -51,7 +57,7 @@ def test_exceptions(qtbot):
51
57
)
52
58
result = testdir .runpytest ()
53
59
if raise_error :
54
- if qt_api . pytest_qt_api == "pyside6" :
60
+ if has_pyside6_exception_capture () :
55
61
# PySide6 automatically captures exceptions during the event loop,
56
62
# and re-raises them when control gets back to Python.
57
63
# This results in the exception not being captured by
You can’t perform that action at this time.
0 commit comments