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

Method assert_pip_not_installed

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

Source from the content-addressed store, hash-verified

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