def get_tests_from_description(name,
                               descriptions,
                               parsed=None):
    """
    Recursively collect all tests in test description.

    Args:
        name (str): Yaml test description file name.
        descriptions (dict): Dict of test description name
                             (key) and absolute file paths
                             (value).
        parsed (list): List of description paths which have
                       already been parsed to prevent infinte
                       recursion.
    Returns:
        A list of expanded test files.
    """
    tests = []
    if not parsed:
        parsed = []

    description = descriptions.get(name, None)
    if not description:
        raise IpaUtilsException(
            'Test description file with name: %s cannot be located.'
            % name
        )

    if description in parsed:
        return tests

    parsed.append(description)
    test_data = get_yaml_config(description)

    if 'tests' in test_data:
        tests += test_data.get('tests')

    if 'include' in test_data:
        for description_name in test_data.get('include'):
            tests += get_tests_from_description(
                description_name,
                descriptions,
                parsed
            )

    return tests
def get_tests_from_description ( name , descriptions , parsed = None ) : tests = [ ] if not parsed : parsed = [ ] description = descriptions . get ( name , None ) if not description : raise IpaUtilsException ( 'Test description file with name: %s cannot be located.' % name ) if description in parsed : return tests parsed . append ( description ) test_data = get_yaml_config ( description ) if 'tests' in test_data : tests += test_data . get ( 'tests' ) if 'include' in test_data : for description_name in test_data . get ( 'include' ) : tests += get_tests_from_description ( description_name , descriptions , parsed ) return tests
Recursively collect all tests in test description.

    Args:
        name (str): Yaml test description file name.
        descriptions (dict): Dict of test description name
                             (key) and absolute file paths
                             (value).
        parsed (list): List of description paths which have
                       already been parsed to prevent infinte
                       recursion.
    Returns:
        A list of expanded test files.