code: def handle_testcase(func):
      def wrapper(self, tmp_path):
          if self.expect_exception is None:
              try:
                  return func(self, tmp_path)
              finally:
                  self.cleanup_test()
          else:
              with pytest.raises(self.expect_exception):
                  try:
                      return func(self, tmp_path)
                  finally:
                      self.cleanup_test()
  
      return wrapper
  
imports: from abc import ABC, abstractmethod
  from pathlib import Path
  import shutil
  from typing import List, Mapping, Optional
  import uuid
  import pytest
  from snakemake import api, settings
  from snakemake_interface_common.utils import lazy_property
  from snakemake_interface_common.plugin_registry.plugin import TaggedSettings
  from snakemake_interface_executor_plugins.settings import ExecutorSettingsBase
  from snakemake_interface_executor_plugins.registry import ExecutorPluginRegistry
  from snakemake_interface_storage_plugins.settings import StorageProviderSettingsBase
label_desc: Use image node_id 1 for calling a global function with example usage: handle_testcase(func) and returns: wrapper, func, func