You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
__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.
=================================== 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 text was updated successfully, but these errors were encountered:
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.The text was updated successfully, but these errors were encountered: