Make sure all warnings in pytest get turned into errors (#2838)

* Make sure all warnings in pytest get turned into errors

* Suppress DeprecationWarnings in test_int_convert and test_numpy_int_convert

* PyLong_AsLong only shouts "Deprecated!" on Python>=3.8

* Fix remaining warnings on PyPy and CPython 3.10-dev
This commit is contained in:
Yannick Jadoul
2021-02-01 14:52:20 +01:00
committed by GitHub
parent 721834b422
commit fe845878d1
3 changed files with 15 additions and 6 deletions

View File

@@ -434,8 +434,7 @@ TEST_SUBMODULE(class_, m) {
struct SamePointer {};
static SamePointer samePointer;
py::class_<SamePointer, std::unique_ptr<SamePointer, py::nodelete>>(m, "SamePointer")
.def(py::init([]() { return &samePointer; }))
.def("__del__", [](SamePointer&) { py::print("__del__ called"); });
.def(py::init([]() { return &samePointer; }));
struct Empty {};
py::class_<Empty>(m, "Empty")