import textwrap


def error_file(built_from: str, message: str) -> str:
    """Return string containing test file. Test fails, prints message to stdout."""
    source = '''\
    """pytest file built from {}"""


    def test_ini_failed():
        """Show a pytest-phmdoctest pytest ini file error."""
        error_message = """
    When checking if {} should be collected, an ini
    file parse error was discovered.
    {}"""
        print(error_message)
        assert False, "error in pytest-phmdoctest pytest ini file"
    '''
    source1 = textwrap.dedent(source)
    source2 = source1.format(built_from, built_from, message)
    return source2