From: Steven Hardy Date: Fri, 30 Aug 2013 10:25:33 +0000 (+0100) Subject: autoscaling test fix assertRaises Exception warning X-Git-Tag: 2014.1~98 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=e710fd3f151c1315cc5093e3547da1c034eebcdb;p=openstack-build%2Fheat-build.git autoscaling test fix assertRaises Exception warning Fix "H202 assertRaises Exception too broad" warning Change-Id: I162dbd8e421b22cbf3a55b7052107c8332b8d59a --- diff --git a/heat/tests/test_autoscaling.py b/heat/tests/test_autoscaling.py index caaa393a..be5884fc 100644 --- a/heat/tests/test_autoscaling.py +++ b/heat/tests/test_autoscaling.py @@ -775,12 +775,12 @@ class AutoScalingTest(HeatTestCase): # Scale up one 1 instance with resource failure self.m.StubOutWithMock(instance.Instance, 'handle_create') - instance.Instance.handle_create().AndRaise(Exception) + instance.Instance.handle_create().AndRaise(exception.Error()) self._stub_lb_reload(1, unset=False, nochange=True) self._stub_validate() self.m.ReplayAll() - self.assertRaises(Exception, rsrc.adjust, 1) + self.assertRaises(exception.Error, rsrc.adjust, 1) self.assertEqual(['WebServerGroup-0'], rsrc.get_instance_names()) self.m.VerifyAll()