Skip to content

Commit a1011b4

Browse files
[pre-commit.ci] pre-commit autoupdate (#748)
Co-authored-by: Bernát Gábor <gaborjbernat@gmail.com>
1 parent 826021c commit a1011b4

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ repos:
55
- id: end-of-file-fixer
66
- id: trailing-whitespace
77
- repo: https://github.com/python-jsonschema/check-jsonschema
8-
rev: "0.37.4"
8+
rev: "0.38.0"
99
hooks:
1010
- id: check-github-workflows
1111
args: ["--verbose"]
@@ -19,11 +19,11 @@ repos:
1919
hooks:
2020
- id: tox-toml-fmt
2121
- repo: https://github.com/tox-dev/pyproject-fmt
22-
rev: "v2.26.0"
22+
rev: "v2.27.0"
2323
hooks:
2424
- id: pyproject-fmt
2525
- repo: https://github.com/astral-sh/ruff-pre-commit
26-
rev: "v0.16.1"
26+
rev: "v0.16.2"
2727
hooks:
2828
- id: ruff-format
2929
- id: ruff-check

tests/test_annotations.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ class Slotted:
9999
class Metaclass(type): ...
100100

101101

102-
PY312_PLUS = sys.version_info >= (3, 12)
102+
# The interpreter reports NoneType instead of None for an unset ParamSpec bound before CPython gh-151955 (fixed at
103+
# patch level, e.g. present in 3.13.15 but not 3.14.7), so probe the runtime instead of the version.
104+
_NONE_BOUND = ", bound= :py:obj:`None`" if P.__bound__ is not None else ""
103105

104106

105107
@pytest.mark.parametrize(
@@ -372,17 +374,15 @@ def test_parse_annotation(annotation: Any, module: str, class_name: str, args: t
372374
pytest.param(Y, r":py:class:`~typing.TypeVar`\ \(``Y``, bound= :py:class:`str`)", id="Y"),
373375
pytest.param(Z, r":py:class:`~typing.TypeVar`\ \(``Z``, bound= A)", id="Z"),
374376
pytest.param(S, r":py:class:`~typing.TypeVar`\ \(``S``, bound= miss)", id="S"),
375-
pytest.param(
376-
P, rf":py:class:`~typing.ParamSpec`\ \(``P``{', bound= :py:obj:`None`' if PY312_PLUS else ''})", id="P"
377-
),
377+
pytest.param(P, rf":py:class:`~typing.ParamSpec`\ \(``P``{_NONE_BOUND})", id="P"),
378378
pytest.param(
379379
P_co,
380-
rf":py:class:`~typing.ParamSpec`\ \(``P_co``{', bound= :py:obj:`None`' if PY312_PLUS else ''}, covariant=True)",
380+
rf":py:class:`~typing.ParamSpec`\ \(``P_co``{_NONE_BOUND}, covariant=True)",
381381
id="P_co",
382382
),
383383
pytest.param(
384384
P_contra,
385-
rf":py:class:`~typing.ParamSpec`\ \(``P_contra``{', bound= :py:obj:`None`' if PY312_PLUS else ''}"
385+
rf":py:class:`~typing.ParamSpec`\ \(``P_contra``{_NONE_BOUND}"
386386
", contravariant=True)",
387387
id="P-contra",
388388
),

0 commit comments

Comments
 (0)