def testAttrrDelete(self): with self.assertRaises(AttributeError) as ctx: debug_exception.debug_exceptions(self.foo.attr_delete)() self.assertIn('Debug info:', str(ctx.exception)) self.assertIn('\n\tObject: ', str(ctx.exception)) self.assertIn('\n\tType: <class \'foo_data.Foo\'>\n\tAttributes: ', str(ctx.exception))
def testAttrStore(self): with self.assertRaises(AttributeError) as ctx: debug_exception.debug_exceptions(self.foo.attr_store)() self.assertIn('Debug info:', str(ctx.exception)) self.assertIn('\n\tObject: ', str(ctx.exception)) self.assertIn('\n\tType: <type \'object\'>\n\tAttributes: ', str(ctx.exception))
def testSubscrDelete(self): with self.assertRaises(IndexError) as ctx: debug_exception.debug_exceptions(self.foo.subscr_delete)() self.assertIn('Debug info:\n\tObject: []\n\tObject len: 0\n\tIndex: 0', str(ctx.exception))