Skip to content

Commit

Permalink
remove deprecated LEGACY_PATH support.
Browse files Browse the repository at this point in the history
Pytest 8.1.0 removed support for that.

No need to change our supported Pytest range, the modern pathlib.Path
support has been there since Pytest 7.0
  • Loading branch information
mr-c committed Mar 4, 2024
1 parent 7493f2e commit 4f6e030
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ PYSOURCES=$(wildcard ${MODULE}/**.py tests/*.py)
DEVPKGS=-rdev-requirements.txt -rtest-requirements.txt -rmypy-requirements.txt
DEBDEVPKGS=pep8 python-autopep8 pylint python-coverage pydocstyle sloccount \
python-flake8 python-mock shellcheck
VERSION=2.4.$(shell TZ=UTC git log --first-parent --max-count=1 \
VERSION=2.5.$(shell TZ=UTC git log --first-parent --max-count=1 \
--format=format:%cd --date=format-local:%Y%m%d%H%M%S)

## all : default task (install in dev mode)
Expand Down
1 change: 1 addition & 0 deletions cwltest/argparser.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Command line argument parsing for cwltest."""

import argparse
import sys
from importlib.metadata import PackageNotFoundError, version
Expand Down
6 changes: 3 additions & 3 deletions cwltest/plugin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Discovers CWL test files and converts them to pytest.Items."""

import argparse
import json
import os
Expand Down Expand Up @@ -27,7 +28,6 @@

if TYPE_CHECKING:
from _pytest._code.code import ExceptionInfo, _TracebackStyle
from _pytest.compat import LEGACY_PATH
from _pytest.config import Config
from _pytest.config import Config as PytestConfig
from _pytest.config import PytestPluginManager
Expand Down Expand Up @@ -198,7 +198,7 @@ def repr_failure(

def reportinfo(self) -> Tuple[Union["os.PathLike[str]", str], Optional[int], str]:
"""Status report."""
return self.fspath, 0, "cwl test: %s" % self.name
return self.path, 0, "cwl test: %s" % self.name


class CWLYamlFile(pytest.File):
Expand Down Expand Up @@ -342,7 +342,7 @@ def _doc_options() -> argparse.ArgumentParser:


def pytest_collect_file(
file_path: Path, path: "LEGACY_PATH", parent: pytest.Collector
file_path: Path, parent: pytest.Collector
) -> Optional[pytest.Collector]:
"""Is this file for us."""
if (
Expand Down
4 changes: 2 additions & 2 deletions docs/pytest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Pytest plugin
*************

``cwltest`` can also be used as a Pytest plugin. The CWL test filename must
end with ``.cwltest.yml`` or ``.cwltest.yaml``.
``cwltest`` can also be used as a Pytest 7.x or 8.x plugin. The CWL test
filename must end with ``.cwltest.yml`` or ``.cwltest.yaml``.

In this case, the simple command::

Expand Down
1 change: 1 addition & 0 deletions tests/test_prepare.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test prepare_test_command()"""

import os

from cwltest import utils
Expand Down
1 change: 1 addition & 0 deletions tests/util.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test functions."""

import atexit
import os
import subprocess # nosec
Expand Down

0 comments on commit 4f6e030

Please sign in to comment.