mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Add a test that the runner script works in environments without pip
This ensures that the runner script can be used in environments where pip is not installed.
This commit is contained in:
parent
00e5adf2aa
commit
470b217e8c
20
tests/functional/test_pip_runner_script.py
Normal file
20
tests/functional/test_pip_runner_script.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
import os
|
||||
from pathlib import Path
|
||||
|
||||
from pip import __version__
|
||||
from tests.lib import PipTestEnvironment
|
||||
|
||||
|
||||
def test_runner_work_in_environments_with_no_pip(
|
||||
script: PipTestEnvironment, pip_src: Path
|
||||
) -> None:
|
||||
runner = pip_src / "src" / "pip" / "__pip-runner__.py"
|
||||
|
||||
# Ensure there's no pip installed in the environment
|
||||
script.pip("uninstall", "pip", "--yes", use_module=True)
|
||||
script.pip("--version", expect_error=True)
|
||||
|
||||
# The runner script should still invoke a usable pip
|
||||
result = script.run("python", os.fspath(runner), "--version")
|
||||
|
||||
assert __version__ in result.stdout
|
Loading…
Reference in a new issue