Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#419)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.284 → v0.0.285](astral-sh/ruff-pre-commit@v0.0.284...v0.0.285)
- [github.com/abravalheri/validate-pyproject: v0.13 → v0.14](abravalheri/validate-pyproject@v0.13...v0.14)

* 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)

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and cclauss authored Aug 22, 2023
1 parent a7fdd19 commit c2fd7f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ ignore = [
"PLR5501",
"PLW2901",
"PT009",
"PT027",
"PTH123",
"RET505",
"RET506",
Expand Down

0 comments on commit c2fd7f2

Please sign in to comment.