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

Method add_sys_path

Lib/test/test_importlib/metadata/fixtures.py:52–57  ·  view source on GitHub ↗
(dir)

Source from the content-addressed store, hash-verified

50 @staticmethod
51 @contextlib.contextmanager
52 def add_sys_path(dir):
53 sys.path[:0] = [str(dir)]
54 try:
55 yield
56 finally:
57 sys.path.remove(str(dir))
58
59 def setUp(self):
60 super().setUp()

Callers 4

setUpMethod · 0.95
test_eggMethod · 0.80

Calls 2

strFunction · 0.85
removeMethod · 0.45

Tested by 3

test_eggMethod · 0.64