diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index 76fa960..40415aa 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -24,7 +24,7 @@ jobs: - '3.9' - '3.10' - '3.11' -# - '3.12' # FixMe: https://github.com/pylint-dev/pylint-pytest/issues/3 + - '3.12' defaults: run: @@ -52,7 +52,10 @@ jobs: env: FORCE_COLOR: 1 PYTEST_CI_ARGS: --cov-report=xml --cov-report=html --junitxml=test_artifacts/test_report.xml --color=yes - run: tox --skip-missing-interpreters=true + run: | + TOX_ENV=$(echo "py${{ matrix.python-version }}" | tr -d .) + tox -e $TOX_ENV + shell: bash - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 diff --git a/CHANGELOG.md b/CHANGELOG.md index e196357..ea52506 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ ## [Unreleased] +### Added + +- Support for Python 3.12 (#24) +- Support for Pylint 3 (#24) + ### Removed - Support for Python 3.6 & 3.7 (#23) 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 32ec894..374b8a4 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 c39b4e3..18cc087 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -124,13 +124,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 82b45f9..821cd3b 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.8", @@ -43,6 +43,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 12d2e63..38853c8 100644 --- a/tests/base_tester.py +++ b/tests/base_tester.py @@ -70,13 +70,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 3430831..cd8467c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py38,py39,py310,py311 +envlist = py{38,39,310,311,312} skipsdist = True passenv = FORCE_COLOR