code: def sha1_store(request):
      """A fixture for setup and teardown.
  
      This only runs once per test function. So don't make this too slow.
  
      Tests must be written in a way that either all of the tests run
      in the order they appears in this file or a specific test is
      run separately by the user. Either way, the test should work.
      """
  
      # Attach a teardown function.
      def teardown():
          os.chdir(TESTING_STORE_DIR.joinpath("..").resolve())
          if TESTING_STORE_DIR.exists():
              shutil.rmtree(TESTING_STORE_DIR)
  
      request.addfinalizer(teardown)
  
      # Teardown in case last run didn't clean it up.
      teardown()
  
      # Get an empty sha1 store.
      sha1_store = SHA1_Store(TESTING_STORE_DIR, init=True)
  
      return sha1_store
  
file_path: fairscale/tests/experimental/wgit/test_sha1_store.py
imports: import os
  from pathlib import Path
  import shutil
  import sys
  import pytest
  import torch
  from torch import nn
  from fairscale.experimental.wgit.sha1_store import SHA1_Store
  from fairscale.fair_dev.testing.testing import objects_are_equal
label_desc: Use image node_id 1 for calling a global function with example usage: sha1_store(request) and returns: sha1_store