Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
hashFiles('pyproject.toml', 'requirements/**.txt') }}" >> $GITHUB_OUTPUT
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache@v4.0.2
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: .venv
key: >-
Expand All @@ -55,7 +55,7 @@ jobs:
hashFiles('.pre-commit-config.yaml') }}" >> $GITHUB_OUTPUT
- name: Restore pre-commit environment
id: cache-precommit
uses: actions/cache@v4.0.2
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: ${{ env.PRE_COMMIT_CACHE }}
key: >-
Expand All @@ -80,14 +80,14 @@ jobs:
check-latest: true
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache@v4.0.2
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: .venv
fail-on-cache-miss: true
key: ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ needs.prepare-base.outputs.python-key }}
- name: Restore pre-commit environment
id: cache-precommit
uses: actions/cache@v4.0.2
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: ${{ env.PRE_COMMIT_CACHE }}
fail-on-cache-miss: true
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ jobs:
- windows-latest
- macos-latest
python-version:
- '3.8'
- '3.9'
- '3.10'
- '3.11'
- '3.12'
- '3.13'
- '3.14'

defaults:
run:
Expand Down Expand Up @@ -62,11 +62,11 @@ jobs:
run: tox --skip-missing-interpreters=true

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
if: ${{ !cancelled() }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: ${{ matrix.os }},${{ matrix.python-version }}
fail_ci_if_error: ${{ github.repository_owner == 'pylint-dev' && 'true' || 'false' }}
fail_ci_if_error: true
files: test_artifacts/cobertura.xml

- name: Create artifacts
Expand Down
19 changes: 12 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ci:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v6.0.0
hooks:
- id: end-of-file-fixer
exclude: ^.idea/
Expand Down Expand Up @@ -34,23 +34,28 @@ repos:
- '4'
- --offset
- '2'
- repo: https://github.com/asottile/pyupgrade
rev: v3.21.2
hooks:
- id: pyupgrade
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.8
rev: v0.14.10
hooks:
- id: ruff
- id: ruff-format
- id: ruff-check
args:
- --fix
exclude: tests/input/
- repo: https://github.com/psf/black
rev: 24.8.0
rev: 25.12.0
hooks:
- id: black
- repo: https://github.com/asottile/blacken-docs
rev: 1.18.0
rev: 1.20.0
hooks:
- id: blacken-docs
additional_dependencies:
- black==24.8.0
- black==25.12.0
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
Expand All @@ -74,7 +79,7 @@ repos:
language: pygrep
types: [python]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.2
rev: v1.19.1
hooks:
- id: mypy
exclude: tests/input/
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

## [Unreleased]

## [2.0.0a1] - _tbd; started 2025-10-17_

A small pylint update lead into a full-blown dependency updates.

That, additionally, lead to deprecating Python 3.8 and 3.9 support.
_Technically_, as of writing this, https://devguide.python.org/versions/ does NOT show 3.9 as deprecated.
However, many dependencies have already dropped support for them - and, according to the page, 3.9's deprecation date 2025-10.

### Development details / information

The project will _soon_ ™️ migrate to `uv` for anything related to packaging, testing, and building:
https://github.com/pylint-dev/pylint-pytest/issues/132

## [2.0.0a0] - 2024-02-02

### Added
Expand Down
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ Requirements:
To install:

```bash
$ pip install pylint-pytest
pip install pylint-pytest
```

## Usage

Enable via command line option `--load-plugins`

```bash
$ pylint --load-plugins pylint_pytest <path_to_your_sources>
pylint --load-plugins pylint_pytest <path_to_your_sources>
```

Or in `.pylintrc`:
Expand Down Expand Up @@ -67,8 +67,7 @@ from fixture_collections import (
) # <- Unused imported_fixture imported from fixture_collections


def test_something(imported_fixture):
...
def test_something(imported_fixture): ...
```

### `redefined-outer-name`
Expand Down Expand Up @@ -130,16 +129,14 @@ import pytest


@pytest.fixture
def awesome_fixture():
...
def awesome_fixture(): ...


@pytest.fixture
@pytest.mark.usefixtures(
"awesome_fixture"
) # <- Using useless `@pytest.mark.*` decorator for fixtures
def another_awesome_fixture():
...
def another_awesome_fixture(): ...
```

### W6403 `deprecated-positional-argument-for-pytest-fixture`
Expand All @@ -151,8 +148,7 @@ import pytest


@pytest.fixture("module") # <- Using a deprecated positional arguments for fixture
def awesome_fixture():
...
def awesome_fixture(): ...
```

### F6401 `cannot-enumerate-pytest-fixtures`
Expand Down
4 changes: 2 additions & 2 deletions pylint_pytest/checkers/class_attr_loader.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from astroid import Assign, Attribute, ClassDef, Name
from astroid.nodes import Assign, Attribute, ClassDef, Name

from ..utils import _can_use_fixture, _is_class_autouse_fixture
from . import BasePytestChecker
Expand Down Expand Up @@ -33,7 +33,7 @@ def visit_assign(self, node: Assign):
and node.value.expr.name == "request"
):
# storing the aliases for cls from request.cls
self.request_cls = set(t.name for t in node.targets)
self.request_cls = {t.name for t in node.targets}

def visit_assignattr(self, node):
if (
Expand Down
4 changes: 2 additions & 2 deletions pylint_pytest/checkers/fixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def visit_module(self, node):

FixtureChecker._pytest_fixtures = fixture_collector.fixtures

legitimate_failure_paths = set(
legitimate_failure_paths = {
collection_report.nodeid
for collection_report in fixture_collector.errors
if any(
Expand All @@ -140,7 +140,7 @@ def visit_module(self, node):
)
for pattern in FILE_NAME_PATTERNS
)
)
}
if (ret != pytest.ExitCode.OK or legitimate_failure_paths) and is_test_module:
files_to_report = {
str(Path(x).absolute().relative_to(Path.cwd()))
Expand Down
4 changes: 2 additions & 2 deletions pylint_pytest/checkers/types.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

from typing import Any, Dict, List
from typing import Any

from _pytest.fixtures import FixtureDef

FixtureDict = Dict[str, List[FixtureDef[Any]]]
FixtureDict = dict[str, list[FixtureDef[Any]]]
2 changes: 1 addition & 1 deletion pylint_pytest/checkers/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from typing import Any

from astroid import Arguments, Module, NodeNG
from astroid.nodes import Arguments, Module, NodeNG
from pylint.checkers.variables import VariablesChecker
from pylint.interfaces import Confidence

Expand Down
14 changes: 6 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "pylint-pytest"
version = "2.0.0a0"
version = "2.0.0a1"
license = {file = "LICENSE"}
description = "A Pylint plugin to suppress pytest-related false positives."

Expand All @@ -24,11 +24,11 @@ classifiers = [
"Topic :: Software Development :: Quality Assurance",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: Implementation :: CPython",
"Operating System :: OS Independent",
"License :: OSI Approved :: MIT License",
Expand All @@ -39,9 +39,9 @@ keywords = [
"plugin",
]

requires-python = ">=3.8"
requires-python = ">= 3.10"
dependencies = [
"pylint>=2,<4",
"pylint >=2, <5",
"pytest>=4.6",
]

Expand Down Expand Up @@ -106,7 +106,7 @@ paths.source = [
profile = "black"

[tool.mypy]
python_version = "3.8"
python_version = "3.10"
check_untyped_defs = true
explicit_package_bases = true
namespace_packages = true
Expand Down Expand Up @@ -148,8 +148,6 @@ fix = true
# (for docstrings, strings and comments in particular).
line-length = 100

target-version = "py38"

[tool.ruff.lint]
select = [
"E", # pycodestyle
Expand Down
3 changes: 1 addition & 2 deletions requirements/dev.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# For linting purposes, only pylint>3 is supported
pylint>=3
pylint>=4

# to handle dependencies
pip-tools
Expand Down
Loading