def call_multiple_modules(module_gen):
    """Call each module

    module_gen should be a iterator
    """
    for args_seq in module_gen:
        module_name_or_path = args_seq[0]
        with replace_sys_args(args_seq):
            if re.match(VALID_PACKAGE_RE, module_name_or_path):
                runpy.run_module(module_name_or_path,
                                 run_name='__main__')
            else:
                runpy.run_path(module_name_or_path,
                               run_name='__main__')
Call each module

    module_gen should be a iterator