MCPcopy
hub / github.com/linkedin/shiv / test_prepend_pythonpath

Method test_prepend_pythonpath

test/test_bootstrap.py:125–138  ·  view source on GitHub ↗
(self, env, extra_path)

Source from the content-addressed store, hash-verified

123 "/path/to/other_package",
124 ])
125 def test_prepend_pythonpath(self, env, extra_path):
126 # Save old path to be able to restore it after executing the test
127 old_path = sys.path.copy()
128
129 env._prepend_pythonpath = extra_path
130 prepend_pythonpath(env)
131 if extra_path is not None:
132 assert len(sys.path) == len(old_path) + 1
133 assert sys.path[0] == extra_path
134 else:
135 assert len(sys.path) == len(old_path)
136
137 # Cleanup
138 sys.path = old_path
139
140
141class TestEnvironment:

Callers

nothing calls this directly

Calls 1

prepend_pythonpathFunction · 0.90

Tested by

no test coverage detected