docstr: Add test/package/ to module search path. This ensures that
  importing our fake packages via, e.g. `import package_a` will always
  work regardless of how we invoke the test.
docstr_tok: ["Add","test\/package\/","to","module","search","path",".","This","ensures","that","importing","our","fake","packages","via",",","e.g",".","`","import","package_a","`","will","always","work","regardless","of","how","we","invoke","the","test","."]
code: def setUp(self):
      """Add test/package/ to module search path. This ensures that
      importing our fake packages via, e.g. `import package_a` will always
      work regardless of how we invoke the test.
      """
      super().setUp()
      self.package_test_dir = os.path.dirname(
          os.path.realpath(__file__)
      )
      self.orig_sys_path = sys.path.copy()
      sys.path.append(self.package_test_dir)
      torch.package.package_exporter._gate_torchscript_serialization = (
          False
      )
  
file_path: pytorch/test/package/common.py
imports: import os
  import sys
  from tempfile import NamedTemporaryFile
  import torch.package.package_exporter
  from torch.testing._internal.common_utils import IS_WINDOWS, TestCase
label_desc: Use image node_id 3 for calling the PackageTestCase obj's underlying member method code with example usage: obj.setUp() without return types