def METHOD_NAME(
    docs_file: typing.TextIO
) -> Tuple[Union[List[str], None], List[env_var_docs.parser.NodeParseError]]:
    """Runs any provided regex tests in an environment variable documentation file.
    Returns a list of environment variable names that failed their tests. Test
    failure or pass messages are printed as the tests are run.
    """
    failures = []
    def run_test(node: env_var_docs.parser.Node):
        if not isinstance(node.details, env_var_docs.parser.Variable):
            return
        var = node.details
        if var.regex is None:
            return
        # appease mypy.
        assert var.regex is not None
        assert var.regex_tests is not None
        result = _run_test(node.name, var.regex, var.regex_tests)
        print(result)
        if result.regex_error != "" or result.failing_matches:
            failures.append(node.name)
    parse_errors = env_var_docs.parser.visit(docs_file, run_test)
    if len(parse_errors) != 0:
        return None, parse_errors
    return failures, []