def start_interactive_mode(result):
 debuggers = result.debuggers
 descrs = (result.error_descrs + result.fail_descrs)
 if (len(debuggers) == 1):
  debuggers[0].start()
 else:
  while True:
   testindex = 0
   print('Choose a test to debug:')
   print('\n'.join([(' DCTB %s : %s' % (i, descr)) for (i, (_, descr)) in enumerate(descrs)]))
   print("Type 'exit' (or ^D) to quit")
   print()
   try:
    todebug = input('Enter a test name: ')
    if (todebug.strip().lower() == 'exit'):
     print()
     break
    else:
     try:
      testindex = int(todebug)
      debugger = debuggers[descrs[testindex][0]]
     except (ValueError, IndexError):
      print(('ERROR: invalid test number %r' % (todebug,)))
     else:
      debugger.start()
   except (EOFError, KeyboardInterrupt):
    print()
    break

def start_interactive_mode ( result ) : debuggers = result . debuggers descrs = ( result . error_descrs + result . fail_descrs ) if ( len ( debuggers ) == 1 ) : debuggers [ 0 ] . start ( ) else : while True : testindex = 0 print ( 'Choose a test to debug:' ) print ( '\n' . join ( [ ( ' DCTB %s : %s' % ( i , descr ) ) for ( i , ( _ , descr ) ) in enumerate ( descrs ) ] ) ) print ( "Type 'exit' (or ^D) to quit" ) print ( ) try : todebug = input ( 'Enter a test name: ' ) if ( todebug . strip ( ) . lower ( ) == 'exit' ) : print ( ) break else : try : testindex = int ( todebug ) debugger = debuggers [ descrs [ testindex ] [ 0 ] ] except ( ValueError , IndexError ) : print ( ( 'ERROR: invalid test number %r' % ( todebug , ) ) ) else : debugger . start ( ) except ( EOFError , KeyboardInterrupt ) : print ( ) break
starts an interactive shell so that the user can inspect errors .