From f647d9d1e93d0b5783acc3cdbb2af3184daab84f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 22 Aug 2023 08:39:23 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.0.284 → v0.0.285](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.284...v0.0.285) - [github.com/abravalheri/validate-pyproject: v0.13 → v0.14](https://github.com/abravalheri/validate-pyproject/compare/v0.13...v0.14) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index db23b353..7cd57e25 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,7 +34,7 @@ repos: - tomli - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.0.284 + rev: v0.0.285 hooks: - id: ruff @@ -49,6 +49,6 @@ repos: - id: pyproject-fmt - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.13 + rev: v0.14 hooks: - id: validate-pyproject From ba95cb01934d21871566621f999862c98de92345 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 22 Aug 2023 10:57:03 +0200 Subject: [PATCH 2/2] pyproject.toml: Ignore ruff rule PT027 % `ruff rule PT009` # pytest-unittest-assertion (PT009) Derived from the **flake8-pytest-style** linter. Autofix is sometimes available. ## What it does Checks for uses of assertion methods from the `unittest` module. ## Why is this bad? To make use of `pytest`'s assertion rewriting, a regular `assert` statement is preferred over `unittest`'s assertion methods. ## Example ```python import unittest class TestFoo(unittest.TestCase): def test_foo(self): self.assertEqual(a, b) ``` Use instead: ```python import unittest class TestFoo(unittest.TestCase): def test_foo(self): assert a == b ``` ## References - [`pytest` documentation: Assertion introspection details](https://docs.pytest.org/en/7.1.x/how-to/assert.html#assertion-introspection-details) --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 9cfc94fe..d9259494 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,6 +59,7 @@ ignore = [ "PLR5501", "PLW2901", "PT009", + "PT027", "PTH123", "RET505", "RET506",