Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
setUp
Method · 0.95
test_unique_distributions
Method · 0.80
test_egg
Method · 0.80
test_entry_points_unique_packages_normalized
Method · 0.80
Calls
2
str
Function · 0.85
remove
Method · 0.45
Tested by
3
test_unique_distributions
Method · 0.64
test_egg
Method · 0.64
test_entry_points_unique_packages_normalized
Method · 0.64