Skip to content

Commit a956052

Browse files
style: pre-commit fixes
1 parent 388366f commit a956052

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

tests/conftest.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,18 +314,27 @@ def backport(sanatized_string: SanitizedString) -> SanitizedString:
314314

315315
return backport
316316

317+
317318
_EXPECTED_T = TypeVar("_EXPECTED_T")
318319

320+
319321
# The implicit conversion from np.float32 is undesirable but currently accepted.
320322
# TODO: Avoid DeprecationWarning in `PyLong_AsLong` (and similar)
321323
# TODO: PyPy 3.8 does not behave like CPython 3.8 here yet (7.3.7)
322324
# https://github.com/pybind/pybind11/issues/3408
323325
@pytest.fixture
324-
def avoid_PyLong_AsLong_deprecation() -> Callable[[Callable[[SupportsIndex], _EXPECTED_T], SupportsIndex, _EXPECTED_T], bool]:
325-
def check(convert: Callable[[SupportsIndex], _EXPECTED_T], value: SupportsIndex, expected: _EXPECTED_T) -> bool:
326+
def avoid_PyLong_AsLong_deprecation() -> Callable[
327+
[Callable[[SupportsIndex], _EXPECTED_T], SupportsIndex, _EXPECTED_T], bool
328+
]:
329+
def check(
330+
convert: Callable[[SupportsIndex], _EXPECTED_T],
331+
value: SupportsIndex,
332+
expected: _EXPECTED_T,
333+
) -> bool:
326334
if sys.version_info < (3, 10) and env.CPYTHON:
327335
with pytest.deprecated_call():
328336
return convert(value) == expected
329337
else:
330338
return convert(value) == expected
331-
return check
339+
340+
return check

tests/test_builtin_casters.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
from __future__ import annotations
22

3-
import sys
4-
53
import pytest
64

7-
import env
85
from pybind11_tests import IncType, UserType
96
from pybind11_tests import builtin_casters as m
107

0 commit comments

Comments
 (0)