(create_pex_venv)
| 113 | |
| 114 | |
| 115 | def test_force(create_pex_venv): |
| 116 | # type: (CreatePexVenv) -> None |
| 117 | venv = create_pex_venv("--pip") |
| 118 | venv.interpreter.execute(args=["-m", "pip", "install", "ansicolors==1.1.8"]) |
| 119 | venv.interpreter.execute(args=["-c", "import colors"]) |
| 120 | |
| 121 | with pytest.raises(CalledProcessError): |
| 122 | create_pex_venv() |
| 123 | |
| 124 | venv_force = create_pex_venv("--force") |
| 125 | # The re-created venv should have no ansicolors installed like the prior venv. |
| 126 | with pytest.raises(Executor.NonZeroExit): |
| 127 | venv_force.interpreter.execute(args=["-c", "import colors"]) |
| 128 | # The re-created venv should have no pip installed either. |
| 129 | with pytest.raises(Executor.NonZeroExit): |
| 130 | venv.interpreter.execute(args=["-m", "pip", "install", "ansicolors==1.1.8"]) |
| 131 | |
| 132 | |
| 133 | def execute_venv_pex_interpreter( |
nothing calls this directly
no test coverage detected