def METHOD_NAME(tmp_path: Path) -> Callable[[Optional[Type[CompilerException]]], CompileData]:
    def do_export(expected_error_type: Optional[Type[CompilerException]] = None) -> CompileData:
        return export_to_file(tmp_path / "myfile", expected_error_type)
    return do_export