def _iterateTests(testSuiteOrCase):
    """
    Iterate through all of the test cases in C{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}.
    
stackoverflow/venv/lib/python3.6/site-packages/twisted/trial/_asyncrunner.py