Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test failure with Python 3.11 #326

Closed
fabaff opened this issue Feb 19, 2023 · 1 comment
Closed

Test failure with Python 3.11 #326

fabaff opened this issue Feb 19, 2023 · 1 comment

Comments

@fabaff
Copy link

fabaff commented Feb 19, 2023

With Python 3.11 I get a test failure.

============================= test session starts ==============================
platform linux -- Python 3.11.1, pytest-7.2.0, pluggy-1.0.0
rootdir: /build/source, configfile: pytest.ini
collected 390 items     
[...]
=================================== FAILURES ===================================
_____________________________ test_frozendict_api ______________________________

    def test_frozendict_api():
        # all the read-only methods that are fine
        through_methods = ['__class__',
                           '__cmp__',
                           '__contains__',
                           '__delattr__',
                           '__dir__',
                           '__eq__',
                           '__format__',
                           '__ge__',
                           '__getattribute__',
                           '__getitem__',
                           '__gt__',
                           '__init__',
                           '__iter__',
                           '__le__',
                           '__len__',
                           '__lt__',
                           '__ne__',
                           '__new__',
                           '__or__',
                           '__reduce__',
                           '__reversed__',
                           '__ror__',
                           '__setattr__',
                           '__sizeof__',
                           '__str__',
                           'copy',
                           'get',
                           'has_key',
                           'items',
                           'iteritems',
                           'iterkeys',
                           'itervalues',
                           'keys',
                           'values',
                           'viewitems',
                           'viewkeys',
                           'viewvalues']
    
        fd = FrozenDict()
        ret = []
        for attrname in dir(fd):
            if attrname == '_hash':  # in the dir, even before it's set
                continue
            attr = getattr(fd, attrname)
            if not callable(attr):
                continue
    
            if getattr(FrozenDict, attrname) == getattr(dict, attrname, None) and attrname not in through_methods:
>               assert attrname == False
E               AssertionError: assert '__getstate__' == False

tests/test_dictutils.py:515: AssertionError
[...]
=========================== short test summary info ============================
FAILED tests/test_dictutils.py::test_frozendict_api - AssertionError: assert '__getstate__' == False
================== 1 failed, 389 passed, 23 warnings in 4.39s ==================

I guess that this will affect all distributions which are shipping boltons and moving to Python 3.11.

mahmoud added a commit that referenced this issue Feb 20, 2023
mahmoud added a commit that referenced this issue Feb 20, 2023
mahmoud added a commit that referenced this issue Feb 20, 2023
* fix py311 test #326, add 3.11 to the local and CI test matrix, and update some references

(had to rebase 🙄 )
@mahmoud
Copy link
Owner

mahmoud commented Feb 20, 2023

This is fixed in master and deployed in 23.0.0. Thanks for the heads up! https://pypi.org/project/boltons/23.0.0/

@mahmoud mahmoud closed this as completed Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants