diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index 9355304..c171f52 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -26,7 +26,7 @@ jobs: - '3.9' - '3.10' - '3.11' - # - '3.12' # FixMe: https://github.com/pylint-dev/pylint-pytest/issues/3 + - '3.12' # Python 3.6 is not available in `ubuntu-latest`. exclude: - python-version: '3.6' @@ -35,6 +35,7 @@ jobs: - python-version: '3.6' os: ubuntu-20.04 + defaults: run: shell: ${{ matrix.os == 'windows-latest' && 'pwsh' || '/bin/bash --noprofile --norc -Eeuxo pipefail {0}' }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 65527d9..d6179e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ## [Unreleased] +### Added + +- Support for Python 3.12 (#24) +- Support for Pylint 3 (#24) + + ## [1.1.6] - 2023-11-20 This is a small bugfix release. diff --git a/pylint_pytest/checkers/class_attr_loader.py b/pylint_pytest/checkers/class_attr_loader.py index 6c9b4e9..40d16cf 100644 --- a/pylint_pytest/checkers/class_attr_loader.py +++ b/pylint_pytest/checkers/class_attr_loader.py @@ -1,14 +1,12 @@ from typing import Optional, Set from astroid import Assign, Attribute, ClassDef, Name -from pylint.interfaces import IAstroidChecker from ..utils import _can_use_fixture, _is_class_autouse_fixture from . import BasePytestChecker class ClassAttrLoader(BasePytestChecker): - __implements__ = IAstroidChecker msgs = {"E6400": ("", "pytest-class-attr-loader", "")} in_setup = False diff --git a/pylint_pytest/checkers/fixture.py b/pylint_pytest/checkers/fixture.py index 258e86d..92d1678 100644 --- a/pylint_pytest/checkers/fixture.py +++ b/pylint_pytest/checkers/fixture.py @@ -8,7 +8,6 @@ import pylint import pytest from pylint.checkers.variables import VariablesChecker -from pylint.interfaces import IAstroidChecker from ..utils import ( _can_use_fixture, @@ -42,7 +41,6 @@ def pytest_collectreport(self, report): class FixtureChecker(BasePytestChecker): - __implements__ = IAstroidChecker msgs = { "W6401": ( "Using a deprecated @pytest.yield_fixture decorator", diff --git a/pyproject.toml b/pyproject.toml index 7e1055a..bd8356a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -125,13 +125,11 @@ load-plugins= [ "pylint.extensions.broad_try_clause", "pylint.extensions.check_elif", "pylint.extensions.code_style", - "pylint.extensions.comparetozero", "pylint.extensions.comparison_placement", "pylint.extensions.confusing_elif", # "pylint.extensions.consider_ternary_expression", # Not a pretty refactoring "pylint.extensions.docparams", "pylint.extensions.docstyle", - "pylint.extensions.emptystring", "pylint.extensions.eq_without_hash", "pylint.extensions.for_any_all", "pylint.extensions.mccabe", diff --git a/setup.py b/setup.py index 9641df3..d5e00bf 100755 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ long_description_content_type="text/markdown", packages=find_packages(exclude=["tests*", "sandbox"]), install_requires=[ - "pylint<3", + "pylint<4", "pytest>=4.6", ], python_requires=">=3.6", @@ -45,6 +45,7 @@ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Programming Language :: Python :: Implementation :: CPython", "Operating System :: OS Independent", "License :: OSI Approved :: MIT License", diff --git a/tests/base_tester.py b/tests/base_tester.py index deed382..a7b1d6c 100644 --- a/tests/base_tester.py +++ b/tests/base_tester.py @@ -79,13 +79,11 @@ def setup_method(self): self.impacted_checkers = [] for key, value in self.CONFIG.items(): - setattr(self.checker.config, key, value) + setattr(self.linter.config, key, value) self.checker.open() for checker_class in self.IMPACTED_CHECKER_CLASSES: checker = checker_class(self.linter) - for key, value in self.CONFIG.items(): - setattr(checker.config, key, value) checker.open() self.impacted_checkers.append(checker) diff --git a/tox.ini b/tox.ini index 09dd02e..11f2f2f 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py36,py37,py38,py39,py310,py311 +envlist = py{36,37,38,39,310,311,312} skipsdist = True passenv = FORCE_COLOR