diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 838e1772f56..d22ea26bf3c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.14.1" + rev: "v0.14.2" hooks: - id: ruff-check args: ["--fix"] @@ -12,7 +12,7 @@ repos: - id: end-of-file-fixer - id: check-yaml - repo: https://github.com/woodruffw/zizmor-pre-commit - rev: v1.15.2 + rev: v1.16.0 hooks: - id: zizmor - repo: https://github.com/adamchainz/blacken-docs @@ -48,7 +48,7 @@ repos: # on <3.11 - exceptiongroup>=1.0.0rc8 - repo: https://github.com/RobertCraigie/pyright-python - rev: v1.1.406 + rev: v1.1.407 hooks: - id: pyright files: ^(src/|scripts/) diff --git a/src/_pytest/timing.py b/src/_pytest/timing.py index 221eeffc4fd..51c3db23f6f 100644 --- a/src/_pytest/timing.py +++ b/src/_pytest/timing.py @@ -84,6 +84,7 @@ def time(self) -> float: return self._current_time def patch(self, monkeypatch: MonkeyPatch) -> None: + # pylint: disable-next=import-self from _pytest import timing # noqa: PLW0406 monkeypatch.setattr(timing, "sleep", self.sleep) diff --git a/testing/python/approx.py b/testing/python/approx.py index dc10a954839..9032e6c0cb4 100644 --- a/testing/python/approx.py +++ b/testing/python/approx.py @@ -5,6 +5,8 @@ import decimal from decimal import Decimal from fractions import Fraction +from math import inf +from math import nan from math import sqrt import operator from operator import eq @@ -16,9 +18,6 @@ from pytest import approx -inf, nan = float("inf"), float("nan") - - @pytest.fixture def mocked_doctest_runner(monkeypatch): import doctest