def METHOD_NAME(tmpdir: str, snippetcompiler_clean, modules_dir: str) -> None:
    """
    verify that the finalizers are called even if there is an exception raised during compilation
    """
    snippetcompiler_clean.setup_for_snippet("", install_project=True)
    v1_template_path: str = os.path.join(modules_dir, "minimalv1module")
    test_module: str = "test_module"
    libs_dir: str = os.path.join(str(tmpdir), "libs")
    test_module_plugin_contents: str = """