Skip to content

[BUG] test_builtin_caster.test_int_convert: Fails on certain minor version of CPython 3.8? #2922

@EricCousineau-TRI

Description

@EricCousineau-TRI

Issue description

Test fails on current mainline branch:

# TODO: Avoid DeprecationWarning in `PyLong_AsLong` (and similar)
if (3, 8) <= env.PY < (3, 10):
with pytest.deprecated_call():
assert convert(Int()) == 42

Reproducible example code

$ cd pybind11
$ git log -n 1 --oneline --no-decorate
0e01c243 Generalizing suppression for pypocketfft. (#2896)
$ mkdir build && cd build
$ cmake .. -GNinja -DPYBIND11_PYTHON_VERSION=3.8 -DPYBIND11_TEST_OVERRIDE=test_builtin_casters.cpp
...
-- PYTHON 3.8.0
...
$ env PYTEST_ADDOPTS="-s -x" ninja pytest
...
        # TODO: Avoid DeprecationWarning in `PyLong_AsLong` (and similar)
        if (3, 8) <= env.PY < (3, 10):
            with pytest.deprecated_call():
>               assert convert(Int()) == 42
E               AssertionError: Did not produce DeprecationWarning or PendingDeprecationWarning

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions