Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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"]
Expand All @@ -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
Expand Down Expand Up @@ -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/)
Expand Down
1 change: 1 addition & 0 deletions src/_pytest/timing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 2 additions & 3 deletions testing/python/approx.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

math is already import for sqrt so there's a slight advantage in using math.inf / math.nan

import operator
from operator import eq
Expand All @@ -16,9 +18,6 @@
from pytest import approx


inf, nan = float("inf"), float("nan")


@pytest.fixture
def mocked_doctest_runner(monkeypatch):
import doctest
Expand Down