Skip to content

Commit c68411b

Browse files
committed
Fix remaining warnings on PyPy and CPython 3.10-dev
1 parent f001e41 commit c68411b

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

tests/test_builtin_casters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ def cant_convert(v):
300300
assert noconvert(7) == 7
301301
cant_convert(3.14159)
302302
# TODO: Avoid DeprecationWarning in `PyLong_AsLong` (and similar)
303-
if env.PY >= (3, 8):
303+
if (3, 8) <= env.PY < (3, 10):
304304
with pytest.deprecated_call():
305305
assert convert(Int()) == 42
306306
else:
@@ -335,7 +335,7 @@ def require_implicit(v):
335335

336336
# The implicit conversion from np.float32 is undesirable but currently accepted.
337337
# TODO: Avoid DeprecationWarning in `PyLong_AsLong` (and similar)
338-
if env.PY >= (3, 8):
338+
if (3, 8) <= env.PY < (3, 10):
339339
with pytest.deprecated_call():
340340
assert convert(np.float32(3.14159)) == 3
341341
else:

tests/test_class.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,8 +434,7 @@ TEST_SUBMODULE(class_, m) {
434434
struct SamePointer {};
435435
static SamePointer samePointer;
436436
py::class_<SamePointer, std::unique_ptr<SamePointer, py::nodelete>>(m, "SamePointer")
437-
.def(py::init([]() { return &samePointer; }))
438-
.def("__del__", [](SamePointer&) { py::print("__del__ called"); });
437+
.def(py::init([]() { return &samePointer; }));
439438

440439
struct Empty {};
441440
py::class_<Empty>(m, "Empty")

0 commit comments

Comments
 (0)