File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 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():
5858
5959
6060@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.' )
6361def test_no_capture (testdir , no_capture_by_marker ):
6462 """
6563 Make sure options that disable exception capture are working (either marker
@@ -77,8 +75,12 @@ def test_no_capture(testdir, no_capture_by_marker):
7775 ''' )
7876 testdir .makepyfile ('''
7977 import pytest
78+ import sys
8079 from pytestqt.qt_compat import QWidget, QtCore
8180
81+ # PyQt 5.5+ will crash if there's no custom exception handler installed
82+ sys.excepthook = lambda *args: None
83+
8284 class MyWidget(QWidget):
8385
8486 def mouseReleaseEvent(self, ev):
@@ -90,8 +92,8 @@ def test_widget(qtbot):
9092 qtbot.addWidget(w)
9193 qtbot.mouseClick(w, QtCore.Qt.LeftButton)
9294 ''' .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*' ] )
9597
9698
9799def test_exception_capture_on_teardown (testdir ):
You can’t perform that action at this time.
0 commit comments