Skip to content

Commit

Permalink
Discard changes to tests/unit/discovery/test_discovery.py
Browse files Browse the repository at this point in the history
  • Loading branch information
flying-sheep committed Apr 23, 2024
1 parent e604c2e commit db5ca7b
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions tests/unit/discovery/test_discovery.py
Expand Up @@ -5,7 +5,6 @@
import sys
from argparse import Namespace
from pathlib import Path
from typing import TYPE_CHECKING
from uuid import uuid4

import pytest
Expand All @@ -14,9 +13,6 @@
from virtualenv.discovery.py_info import PythonInfo
from virtualenv.info import fs_supports_symlink

if TYPE_CHECKING:
from virtualenv.app_data.base import AppData


@pytest.mark.skipif(not fs_supports_symlink(), reason="symlink not supported")
@pytest.mark.parametrize("case", ["mixed", "lower", "upper"])
Expand Down Expand Up @@ -44,26 +40,6 @@ def test_discovery_via_path(monkeypatch, case, tmp_path, caplog, session_app_dat
assert interpreter is not None


@pytest.mark.skipif(not fs_supports_symlink(), reason="symlink not supported")
def test_discovery_via_path_specific(
monkeypatch: pytest.MonkeyPatch, tmp_path: Path, caplog: pytest.LogCaptureFixture, session_app_data: AppData
):
"""Test that a generic spec (e.g. python3) can be used to find a specific interpreter (e.g. python3.12)"""
caplog.set_level(logging.DEBUG)
current = PythonInfo.current_system(session_app_data)
name = "somethingVeryCryptic"
spec = f"{name}{current.version_info.major}"
exe_name = f"{name}{'.'.join(str(i) for i in current.version_info[:2])}{'.exe' if sys.platform == 'win32' else ''}"
target = tmp_path / current.install_path("scripts")
target.mkdir(parents=True)
executable = target / exe_name
os.symlink(sys.executable, str(executable))
monkeypatch.setenv("PATH", str(target))
interpreter = get_interpreter(spec, [])

assert interpreter is not None


def test_discovery_via_path_not_found(tmp_path, monkeypatch):
monkeypatch.setenv("PATH", str(tmp_path))
interpreter = get_interpreter(uuid4().hex, [])
Expand Down

0 comments on commit db5ca7b

Please sign in to comment.