I\'m trying to run this test: self.assertRaises(AttributeError, branch[0].childrennodes), and branch[0] does not have an attribute childrenno
self.assertRaises(AttributeError, branch[0].childrennodes)
branch[0
childrenno
pytest also has a similar decorator:
from pytest import raises def test_raising(): with raises(AttributeError): branch[0].childrennodes