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

Method test_virtualenv_in_list

Lib/test/test_launcher.py:533–554  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

531 self.assertEqual("PythonTestSuite/3.100", default)
532
533 def test_virtualenv_in_list(self):
534 with self.fake_venv() as (venv_exe, env):
535 data = self.run_py(["-0p"], env=env)
536 for line in data["stdout"].splitlines():
537 m = re.match(r"\s*\*\s+(.+)$", line)
538 if m:
539 self.assertEqual(str(venv_exe), m.group(1))
540 break
541 else:
542 if support.verbose:
543 print(data["stdout"])
544 print(data["stderr"])
545 self.fail("did not find active venv path")
546
547 data = self.run_py(["-0"], env=env)
548 for line in data["stdout"].splitlines():
549 m = re.match(r"\s*\*\s+(.+)$", line)
550 if m:
551 self.assertEqual("Active venv", m.group(1))
552 break
553 else:
554 self.fail("did not find active venv entry")
555
556 def test_virtualenv_with_env(self):
557 with self.fake_venv() as (venv_exe, env):

Callers

nothing calls this directly

Calls 8

strFunction · 0.85
fake_venvMethod · 0.80
run_pyMethod · 0.80
splitlinesMethod · 0.45
matchMethod · 0.45
assertEqualMethod · 0.45
groupMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected