Skip to content

Commit d4fe3fe

Browse files
rwgkInvincibleRMCgentlegiantJGC
committed
Replace env.deprecated_call() with pytest.deprecated_call()
Since we already require pytest>=6 (see tests/requirements.txt), the old compatibility function is obsolete and pytest.deprecated_call() can be used directly. Extracted from PR pybind#5879 Co-authored-by: Michael Carlstrom <rmc@carlstrom.com> Co-authored-by: gentlegiantJGC <gentlegiantJGC@users.noreply.github.com>
1 parent 3370fe1 commit d4fe3fe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/test_builtin_casters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ def cant_convert(v):
304304
# TODO: Avoid DeprecationWarning in `PyLong_AsLong` (and similar)
305305
# TODO: PyPy 3.8 does not behave like CPython 3.8 here yet (7.3.7)
306306
if sys.version_info < (3, 10) and env.CPYTHON:
307-
with env.deprecated_call():
307+
with pytest.deprecated_call():
308308
assert convert(Int()) == 42
309309
else:
310310
assert convert(Int()) == 42
@@ -377,7 +377,7 @@ def require_implicit(v):
377377
# TODO: PyPy 3.8 does not behave like CPython 3.8 here yet (7.3.7)
378378
# https://github.com/pybind/pybind11/issues/3408
379379
if (3, 8) <= sys.version_info < (3, 10) and env.CPYTHON:
380-
with env.deprecated_call():
380+
with pytest.deprecated_call():
381381
assert convert(np.float32(3.14159)) == 3
382382
else:
383383
assert convert(np.float32(3.14159)) == 3

0 commit comments

Comments
 (0)