Skip to content

Commit ea2318f

Browse files
committed
Minor zipapp-related fixes and skips for some tests
1 parent c7e7e42 commit ea2318f

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

tests/functional/test_cli.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
],
1717
)
1818
def test_entrypoints_work(entrypoint: str, script: PipTestEnvironment) -> None:
19+
if script.zipapp:
20+
pytest.skip("Zipapp does not include entrypoints")
21+
1922
fake_pkg = script.temp_path / "fake_pkg"
2023
fake_pkg.mkdir()
2124
fake_pkg.joinpath("setup.py").write_text(

tests/functional/test_completion.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,12 @@ def test_completion_for_supported_shells(
107107
Test getting completion for bash shell
108108
"""
109109
result = script_with_launchers.pip("completion", "--" + shell, use_module=False)
110-
assert completion in result.stdout, str(result.stdout)
110+
actual = str(result.stdout)
111+
if script_with_launchers.zipapp:
112+
# The zipapp reports its name as "pip.pyz", but the expected
113+
# output assumes "pip"
114+
actual = actual.replace("pip.pyz", "pip")
115+
assert completion in actual, actual
111116

112117

113118
@pytest.fixture(scope="session")

tests/lib/test_lib.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ def test_correct_pip_version(script: PipTestEnvironment) -> None:
4141
"""
4242
Check we are running proper version of pip in run_pip.
4343
"""
44+
45+
if script.zipapp:
46+
pytest.skip("Test relies on the pip under test being in the filesystem")
47+
4448
# output is like:
4549
# pip PIPVERSION from PIPDIRECTORY (python PYVERSION)
4650
result = script.pip("--version")

0 commit comments

Comments
 (0)