MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_prefixes

Method test_prefixes

Lib/test/test_venv.py:268–284  ·  view source on GitHub ↗

Test that the prefix values are as expected.

(self)

Source from the content-addressed store, hash-verified

266
267 @requireVenvCreate
268 def test_prefixes(self):
269 """
270 Test that the prefix values are as expected.
271 """
272 # check a venv's prefixes
273 rmtree(self.env_dir)
274 self.run_with_capture(venv.create, self.env_dir)
275 cmd = [self.envpy(), '-c', None]
276 for prefix, expected in (
277 ('prefix', self.env_dir),
278 ('exec_prefix', self.env_dir),
279 ('base_prefix', sys.base_prefix),
280 ('base_exec_prefix', sys.base_exec_prefix)):
281 cmd[2] = 'import sys; print(sys.%s)' % prefix
282 out, err = check_output(cmd)
283 self.assertEqual(pathlib.Path(out.strip().decode()),
284 pathlib.Path(expected), prefix)
285
286 @requireVenvCreate
287 def test_sysconfig(self):

Callers

nothing calls this directly

Calls 7

rmtreeFunction · 0.90
run_with_captureMethod · 0.80
envpyMethod · 0.80
check_outputFunction · 0.70
assertEqualMethod · 0.45
decodeMethod · 0.45
stripMethod · 0.45

Tested by

no test coverage detected