

def assertRaisesWithMessageIn(self, exc, msg, func, *args, **kwargs):
    try:
        func(*args, **kwargs)
        self.fail('Exception "{0}" raised.'.format(exc))
    except Exception as inst:
        self.assertIsInstance(inst, exc)
        self.assertIn(msg, inst.message)

dataset/ETHPy150Open openstack/fuel-web/nailgun/nailgun/test/base.py BaseUnitTest.assertRaisesWithMessageIn/original