MCPcopy Index your code
hub / github.com/python/cpython / setUp

Method setUp

Lib/test/test_importlib/test_pkg_import.py:26–33  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

24 del sys.modules[module_name]
25
26 def setUp(self):
27 self.test_dir = tempfile.mkdtemp()
28 sys.path.append(self.test_dir)
29 self.package_dir = os.path.join(self.test_dir,
30 self.package_name)
31 os.mkdir(self.package_dir)
32 create_empty_file(os.path.join(self.package_dir, '__init__.py'))
33 self.module_path = os.path.join(self.package_dir, 'foo.py')
34
35 def tearDown(self):
36 shutil.rmtree(self.test_dir)

Callers

nothing calls this directly

Calls 5

create_empty_fileFunction · 0.90
mkdtempMethod · 0.80
appendMethod · 0.45
joinMethod · 0.45
mkdirMethod · 0.45

Tested by

no test coverage detected