Skip to content

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

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions