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:
Eric Cousineau
2021-04-02 14:34:09 -04:00
committed by GitHub
parent 1259db6fd9
commit f676782bec
2 changed files with 21 additions and 2 deletions

View File

@@ -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