def test_abort_typeerror(question, qtbot, mocker, caplog):
 signal_mock = mocker.patch('qutebrowser.utils.usertypes.Question.aborted')
 signal_mock.emit.side_effect = TypeError
 with caplog.at_level(logging.ERROR, 'misc'):
  question.abort()
 assert (caplog.records[0].message == 'Error while aborting question')

def test_abort_typeerror ( question , qtbot , mocker , caplog ) : signal_mock = mocker . patch ( 'qutebrowser.utils.usertypes.Question.aborted' ) signal_mock . emit . side_effect = TypeError with caplog . at_level ( logging . ERROR , 'misc' ) : question . abort ( ) assert ( caplog . records [ 0 ] . message == 'Error while aborting question' )
test question .