def _iterateTests(testSuiteOrCase):
 try:
  suite = iter(testSuiteOrCase)
 except TypeError:
  (yield testSuiteOrCase)
 else:
  for test in suite:
   for subtest in _iterateTests(test):
    (yield subtest)

def _iterateTests ( testSuiteOrCase ) : try : suite = iter ( testSuiteOrCase ) except TypeError : ( yield testSuiteOrCase ) else : for test in suite : for subtest in _iterateTests ( test ) : ( yield subtest )
iterate through all of the test cases in c{testsuiteorcase} .