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

Method assert_pip_not_installed

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

Source from the content-addressed store, hash-verified

906class EnsurePipTest(BaseTest):
907 """Test venv module installation of pip."""
908 def assert_pip_not_installed(self):
909 out, err = check_output([self.envpy(real_env_dir=True), '-c',
910 'try:\n import pip\nexcept ImportError:\n print("OK")'])
911 # We force everything to text, so unittest gives the detailed diff
912 # if we get unexpected results
913 err = err.decode("latin-1") # Force to text, prevent decoding errors
914 self.assertEqual(err, "")
915 out = out.decode("latin-1") # Force to text, prevent decoding errors
916 self.assertEqual(out.strip(), "OK")
917
918
919 def test_no_pip_by_default(self):

Callers 3

test_explicit_no_pipMethod · 0.95
do_test_with_pipMethod · 0.95

Calls 5

envpyMethod · 0.80
check_outputFunction · 0.70
decodeMethod · 0.45
assertEqualMethod · 0.45
stripMethod · 0.45

Tested by

no test coverage detected