[New-bugs-announce] [issue45859] test_collections has a wrong test in case _itemgetter is not available

Carl Friedrich Bolz-Tereick report at bugs.python.org
Sun Nov 21 15:46:31 EST 2021


New submission from Carl Friedrich Bolz-Tereick <cfbolz at gmx.de>:

test_field_descriptor in test_collections tries to pickle the descriptors of a namedtuple's fields, which is _collections._itemgetter on CPython. However, on PyPy that class doesn't exist. The code in collections deals fine with that fact, but the above-mentioned test does not make sense in that situation, since you can't pickle properties.

To test this behaviour, you can replace
"from _collections import _tuplegetter"
in collections/__init__.py with raise ImportError and see the test fail on CPython too.

----------
messages: 406738
nosy: Carl.Friedrich.Bolz
priority: normal
severity: normal
status: open
title: test_collections has a wrong test in case _itemgetter is not available
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45859>
_______________________________________


More information about the New-bugs-announce mailing list