File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -58,8 +58,6 @@ def test_format_captured_exceptions():
58
58
59
59
60
60
@pytest .mark .parametrize ('no_capture_by_marker' , [True , False ])
61
- @pytest .mark .skipif (QT_API == 'pyqt5' , reason = 'non captured exceptions on PyQt'
62
- ' 5.5+ crash the interpreter.' )
63
61
def test_no_capture (testdir , no_capture_by_marker ):
64
62
"""
65
63
Make sure options that disable exception capture are working (either marker
@@ -77,8 +75,12 @@ def test_no_capture(testdir, no_capture_by_marker):
77
75
''' )
78
76
testdir .makepyfile ('''
79
77
import pytest
78
+ import sys
80
79
from pytestqt.qt_compat import QWidget, QtCore
81
80
81
+ # PyQt 5.5+ will crash if there's no custom exception handler installed
82
+ sys.excepthook = lambda *args: None
83
+
82
84
class MyWidget(QWidget):
83
85
84
86
def mouseReleaseEvent(self, ev):
@@ -90,8 +92,8 @@ def test_widget(qtbot):
90
92
qtbot.addWidget(w)
91
93
qtbot.mouseClick(w, QtCore.Qt.LeftButton)
92
94
''' .format (marker_code = marker_code ))
93
- res = testdir .inline_run ()
94
- res .assertoutcome ( passed = 1 )
95
+ res = testdir .runpytest ()
96
+ res .stdout . fnmatch_lines ([ '*1 passed*' ] )
95
97
96
98
97
99
def test_exception_capture_on_teardown (testdir ):
You can’t perform that action at this time.
0 commit comments