-
-
Notifications
You must be signed in to change notification settings - Fork 70
Closed
Labels
Description
Consider the code below: The line Error 1 should appear in the stderr, but only Error 2 appears.
This happens because exceptions.format_captured_exceptions is a custom exception printer that doesn't take into account the exception cause.
from pytestqt.qt_compat import qt_api
class MyWidget(qt_api.QWidget):
def method(self):
raise RuntimeError('Error 1')
def event(self, ev):
called.append(1)
try:
self.method()
finally:
raise RuntimeError('Error 2')
weak_ref = None
called = []
def test_1(qapp):
global weak_ref
w = MyWidget()
qapp.postEvent(w, qt_api.QEvent(qt_api.QEvent.User))
qapp.processEvents()
assert len(called) > 0
w.deleteLater()