def unwrap_suite(test):
 if isinstance(test, unittest.TestCase):
  (yield test)
  return
 subtests = list(test)
 if (not len(subtests)):
  (yield test)
  return
 for item in itertools.chain.from_iterable(itertools.imap(unwrap_suite, subtests)):
  (yield item)

def unwrap_suite ( test ) : if isinstance ( test , unittest . TestCase ) : ( yield test ) return subtests = list ( test ) if ( not len ( subtests ) ) : ( yield test ) return for item in itertools . chain . from_iterable ( itertools . imap ( unwrap_suite , subtests ) ) : ( yield item )
attempts to unpack testsuites in order to generate a single stream of terminals .