Skip to content

Commit

Permalink
Skip tcsh tests on broken tcsh versions
Browse files Browse the repository at this point in the history
Signed-off-by: Bernát Gábor <[email protected]>
  • Loading branch information
gaborbernat committed Jan 3, 2025
1 parent baf2da4 commit 8b770c3
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ repos:
hooks:
- id: pyproject-fmt
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.8.3"
rev: "v0.8.5"
hooks:
- id: ruff-format
- id: ruff
Expand Down
1 change: 1 addition & 0 deletions docs/changelog/2814.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Skip tcsh tests on broken tcsh versions - by :user:`gaborbernat`.
4 changes: 2 additions & 2 deletions src/virtualenv/discovery/builtin.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import sys
from contextlib import suppress
from pathlib import Path
from typing import TYPE_CHECKING, Callable
from typing import TYPE_CHECKING

from virtualenv.info import IS_WIN, fs_path_id

Expand All @@ -15,7 +15,7 @@

if TYPE_CHECKING:
from argparse import ArgumentParser
from collections.abc import Generator, Iterable, Mapping, Sequence
from collections.abc import Callable, Generator, Iterable, Mapping, Sequence

from virtualenv.app_data.base import AppData
LOGGER = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/activation/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def __call__(self, monkeypatch, tmp_path):
try:
process = Popen(invoke, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=env)
raw_, _ = process.communicate()
raw = raw_.decode()
raw = raw_.decode(errors="replace")
assert process.returncode == 0, raw
except subprocess.CalledProcessError as exception:
output = exception.output + exception.stderr
Expand Down
9 changes: 9 additions & 0 deletions tests/unit/activation/test_csh.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
from __future__ import annotations

from subprocess import check_output

import pytest
from packaging.version import Version

from virtualenv.activation import CShellActivator


def test_csh(activation_tester_class, activation_tester):
version = Version(check_output(["csh", "--version"], text=True).split(" ")[1]) # noqa: S607
if version >= Version("6.24.14"):
pytest.skip("https://github.com/tcsh-org/tcsh/issues/117")

class Csh(activation_tester_class):
def __init__(self, session) -> None:
super().__init__(CShellActivator, session, "csh", "activate.csh", "csh")
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/create/test_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def test_create_cachedir_tag_exists_override(tmp_path: Path) -> None:

def test_create_vcs_ignore_exists(tmp_path):
git_ignore = tmp_path / ".gitignore"
git_ignore.write_text("magic", encoding="utf-8")
git_ignore.write_ttoxext("magic", encoding="utf-8")
cli_run([str(tmp_path), "--without-pip", "--activators", ""])
assert git_ignore.read_text(encoding="utf-8") == "magic"

Expand Down
3 changes: 2 additions & 1 deletion tests/unit/seed/wheels/test_acquire.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from datetime import datetime, timezone
from pathlib import Path
from subprocess import CalledProcessError
from typing import TYPE_CHECKING, Callable
from typing import TYPE_CHECKING

import pytest

Expand All @@ -16,6 +16,7 @@
from virtualenv.seed.wheels.util import Wheel, discover_wheels

if TYPE_CHECKING:
from collections.abc import Callable
from unittest.mock import MagicMock

from pytest_mock import MockerFixture
Expand Down

0 comments on commit 8b770c3

Please sign in to comment.