summaryrefslogtreecommitdiff
path: root/tests/integration/test_run_int.py
blob: 8f4cc16d241c4d94a211ee4a3465a9a1468601e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from __future__ import annotations

from pathlib import Path

import pytest

from virtualenv import cli_run
from virtualenv.info import IS_PYPY
from virtualenv.util.subprocess import run_cmd


@pytest.mark.skipif(IS_PYPY, reason="setuptools distutils patching does not work")
def test_app_data_pinning(tmp_path: Path) -> None:
    version = "23.0"
    result = cli_run([str(tmp_path), "--pip", version, "--activators", "", "--seeder", "app-data"])
    code, out, _ = run_cmd([str(result.creator.script("pip")), "list", "--disable-pip-version-check"])
    assert not code
    for line in out.splitlines():
        parts = line.split()
        if parts and parts[0] == "pip":
            assert parts[1] == version
            break
    else:
        assert not out