mirror of
https://github.com/pybind/pybind11.git
synced 2026-03-14 20:27:47 +00:00
env: Add surrogate for pytest.deprecated_call for ptyest<3.9 (#2923)
env: Add surrogate for pytest.deprecated_call for ptyest<3.9
This commit is contained in:
@@ -301,7 +301,7 @@ def test_int_convert():
|
||||
cant_convert(3.14159)
|
||||
# TODO: Avoid DeprecationWarning in `PyLong_AsLong` (and similar)
|
||||
if (3, 8) <= env.PY < (3, 10):
|
||||
with pytest.deprecated_call():
|
||||
with env.deprecated_call():
|
||||
assert convert(Int()) == 42
|
||||
else:
|
||||
assert convert(Int()) == 42
|
||||
@@ -336,7 +336,7 @@ def test_numpy_int_convert():
|
||||
# The implicit conversion from np.float32 is undesirable but currently accepted.
|
||||
# TODO: Avoid DeprecationWarning in `PyLong_AsLong` (and similar)
|
||||
if (3, 8) <= env.PY < (3, 10):
|
||||
with pytest.deprecated_call():
|
||||
with env.deprecated_call():
|
||||
assert convert(np.float32(3.14159)) == 3
|
||||
else:
|
||||
assert convert(np.float32(3.14159)) == 3
|
||||
|
||||
Reference in New Issue
Block a user