@pytest.mark.parametrize('mode, answer, signal_names', [(usertypes.PromptMode.text, 'foo', ['answered', 'completed']), (usertypes.PromptMode.yesno, True, ['answered', 'completed', 'answered_yes']), (usertypes.PromptMode.yesno, False, ['answered', 'completed', 'answered_no'])])
def test_done(mode, answer, signal_names, question, qtbot):
 question.mode = mode
 question.answer = answer
 signals = [getattr(question, name) for name in signal_names]
 with qtbot.waitSignals(signals, order='strict'):
  question.done()
 assert (not question.is_aborted)

@ pytest . mark . parametrize ( 'mode, answer, signal_names' , [ ( usertypes . PromptMode . text , 'foo' , [ 'answered' , 'completed' ] ) , ( usertypes . PromptMode . yesno , True , [ 'answered' , 'completed' , 'answered_yes' ] ) , ( usertypes . PromptMode . yesno , False , [ 'answered' , 'completed' , 'answered_no' ] ) ] ) def test_done ( mode , answer , signal_names , question , qtbot ) : question . mode = mode question . answer = answer signals = [ getattr ( question , name ) for name in signal_names ] with qtbot . waitSignals ( signals , order = 'strict' ) : question . done ( ) assert ( not question . is_aborted )
test the done method and completed/answered signals .