The tests fail with Python 3.13.0b1 with the traceback below.
=================================== FAILURES ===================================
__________________ test_reserved_attributes[__firstlineno__] ___________________
attrname = '__firstlineno__'
@pytest.mark.parametrize("attrname", dir(Munch))
def test_reserved_attributes(attrname):
# Make sure that the default attributes on the Munch instance are
# accessible.
taken_munch = Munch(**{attrname: 'abc123'})
# Make sure that the attribute is determined as in the filled collection...
assert attrname in taken_munch
# ...and that it is available using key access...
assert taken_munch[attrname] == 'abc123'
# ...but that it is not available using attribute access.
attr = getattr(taken_munch, attrname)
assert attr != 'abc123'
empty_munch = Munch()
# Make sure that the attribute is not seen contained in the empty
# collection...
assert attrname not in empty_munch
# ...and that the attr is of the correct original type.
attr = getattr(empty_munch, attrname)
if attrname == '__doc__':
assert isinstance(attr, str)
elif attrname in ('__hash__', '__weakref__'):
assert attr is None
elif attrname == '__module__':
assert attr == 'munch'
elif attrname == '__dict__':
assert attr == {}
else:
> assert callable(attr)
E assert False
E + where False = callable(35)
tests/test_munch.py:229: AssertionError
_______________ test_reserved_attributes[__static_attributes__] ________________
attrname = '__static_attributes__'
@pytest.mark.parametrize("attrname", dir(Munch))
def test_reserved_attributes(attrname):
# Make sure that the default attributes on the Munch instance are
# accessible.
taken_munch = Munch(**{attrname: 'abc123'})
# Make sure that the attribute is determined as in the filled collection...
assert attrname in taken_munch
# ...and that it is available using key access...
assert taken_munch[attrname] == 'abc123'
# ...but that it is not available using attribute access.
attr = getattr(taken_munch, attrname)
assert attr != 'abc123'
empty_munch = Munch()
# Make sure that the attribute is not seen contained in the empty
# collection...
assert attrname not in empty_munch
# ...and that the attr is of the correct original type.
attr = getattr(empty_munch, attrname)
if attrname == '__doc__':
assert isinstance(attr, str)
elif attrname in ('__hash__', '__weakref__'):
assert attr is None
elif attrname == '__module__':
assert attr == 'munch'
elif attrname == '__dict__':
assert attr == {}
else:
> assert callable(attr)
E AssertionError: assert False
E + where False = callable(('update', '__class__'))
tests/test_munch.py:229: AssertionError
The tests fail with Python 3.13.0b1 with the traceback below.
per https://docs.python.org/dev/whatsnew/3.13.html:
__firstlineno__is the line number of the first line of the class definition__static_attributes__is a tuple of names of attributes of this class which are accessed through self.X from any function in its body. For munch, the value is('update', '__class__'), but I'm not entirely sure it's fixed.