Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pre-commit.ci] pre-commit autoupdate (#419)
* [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