{"action":"closed","issue":{"url":"https://api.github.com/repos/pytest-dev/pytest-qt/issues/59","labels_url":"https://api.github.com/repos/pytest-dev/pytest-qt/issues/59/labels{/name}","comments_url":"https://api.github.com/repos/pytest-dev/pytest-qt/issues/59/comments","events_url":"https://api.github.com/repos/pytest-dev/pytest-qt/issues/59/events","html_url":"https://github.com/pytest-dev/pytest-qt/issues/59","id":87470011,"number":59,"title":"waitSignal swallows exceptions with raising=True","user":{"login":"The-Compiler","id":625793,"avatar_url":"https://avatars.githubusercontent.com/u/625793?v=3","gravatar_id":"","url":"https://api.github.com/users/The-Compiler","html_url":"https://github.com/The-Compiler","followers_url":"https://api.github.com/users/The-Compiler/followers","following_url":"https://api.github.com/users/The-Compiler/following{/other_user}","gists_url":"https://api.github.com/users/The-Compiler/gists{/gist_id}","starred_url":"https://api.github.com/users/The-Compiler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/The-Compiler/subscriptions","organizations_url":"https://api.github.com/users/The-Compiler/orgs","repos_url":"https://api.github.com/users/The-Compiler/repos","events_url":"https://api.github.com/users/The-Compiler/events{/privacy}","received_events_url":"https://api.github.com/users/The-Compiler/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-11T19:33:35Z","updated_at":"2015-06-11T22:11:01Z","closed_at":"2015-06-11T22:11:01Z","body":"When `qtbot.waitSignal(..., raising=True)` is used and an exception in the with-block happens (which causes the signal to not be emitted), it's silently ignored and `SignalTimeoutError` is raised instead.\r\n\r\nI don't really know what the best way to fix this would be (because of the existing Qt exception capturing), but I have a test case:\r\n\r\n```diff\r\ndiff --git a/pytestqt/_tests/test_wait_signal.py b/pytestqt/_tests/test_wait_signal.py\r\nindex 13a78c7..cd5ea57 100644\r\n--- a/pytestqt/_tests/test_wait_signal.py\r\n+++ b/pytestqt/_tests/test_wait_signal.py\r\n@@ -10,6 +10,29 @@ class Signaller(QtCore.QObject):\r\n     signal_2 = Signal()\r\n \r\n \r\n+class TestException(Exception):\r\n+    pass\r\n+\r\n+\r\n+@pytest.mark.parametrize('multiple', [True, False])\r\n+def test_raising_other_exception(qtbot, multiple):\r\n+    \"\"\"\r\n+    Make sure waitSignal with raising=True handles exceptions correctly.\r\n+    \"\"\"\r\n+    signaller = Signaller()\r\n+\r\n+    if multiple:\r\n+        func = qtbot.waitSignals\r\n+        arg = [signaller.signal, signaller.signal_2]\r\n+    else:\r\n+        func = qtbot.waitSignal\r\n+        arg = signaller.signal\r\n+\r\n+    with pytest.raises(TestException):\r\n+        with func(arg, timeout=10, raising=True):\r\n+            raise TestException\r\n+\r\n+\r\n def test_signal_blocker_exception(qtbot):\r\n     \"\"\"\r\n     Make sure waitSignal without signals and timeout doesn't hang, but raises\r\n```\r\n"}}