File: test_run_int.py

package info (click to toggle)
python-virtualenv 20.33.1%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 1,124 kB
  • sloc: python: 10,907; sh: 160; ansic: 61; csh: 47; makefile: 8
file content (27 lines) | stat: -rw-r--r-- 820 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from __future__ import annotations

from typing import TYPE_CHECKING

import pytest

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

if TYPE_CHECKING:
    from pathlib import Path


@pytest.mark.skipif(IS_PYPY, reason="setuptools distutils patching does not work")
def test_app_data_pinning(tmp_path: Path) -> None:
    version = "23.1"
    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