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

Method test_deactivate_with_strict_bash_opts

Lib/test/test_venv.py:642–657  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

640
641 @unittest.skipIf(os.name == 'nt', 'not relevant on Windows')
642 def test_deactivate_with_strict_bash_opts(self):
643 bash = shutil.which("bash")
644 if bash is None:
645 self.skipTest("bash required for this test")
646 rmtree(self.env_dir)
647 builder = venv.EnvBuilder(clear=True)
648 builder.create(self.env_dir)
649 activate = os.path.join(self.env_dir, self.bindir, "activate")
650 test_script = os.path.join(self.env_dir, "test_strict.sh")
651 with open(test_script, "w") as f:
652 f.write("set -euo pipefail\n"
653 f"source {activate}\n"
654 "deactivate\n")
655 out, err = check_output([bash, test_script])
656 self.assertEqual(out, "".encode())
657 self.assertEqual(err, "".encode())
658
659
660 @unittest.skipUnless(sys.platform == 'darwin', 'only relevant on macOS')

Callers

nothing calls this directly

Calls 9

rmtreeFunction · 0.90
skipTestMethod · 0.80
check_outputFunction · 0.70
openFunction · 0.50
createMethod · 0.45
joinMethod · 0.45
writeMethod · 0.45
assertEqualMethod · 0.45
encodeMethod · 0.45

Tested by

no test coverage detected