]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
flake8 H202 error in test_image_utils.py
authorKui Shi <skuicloud@gmail.com>
Wed, 21 Aug 2013 02:48:55 +0000 (10:48 +0800)
committerKui Shi <skuicloud@gmail.com>
Wed, 21 Aug 2013 02:58:08 +0000 (10:58 +0800)
H202 will detect following case:
self.assertRaises(Exception, foo)

Replace Exception with test.TestingException to pass the H202 checking.

Bug #1214365

Change-Id: Idbd13d11995e6a22e99bb9d63c344a5b1a75f987

cinder/tests/test_image_utils.py

index 86e690d65c34fe7762ba0dfc1429a57e54e70eaf..09f0f79920278d9c6f503dc108e03edbc91ad4d6 100644 (file)
@@ -184,9 +184,9 @@ class TestTemporaryFile(test.TestCase):
 
         def sut():
             with image_utils.temporary_file():
-                raise Exception()
+                raise test.TestingException()
 
-        self.assertRaises(Exception, sut)
+        self.assertRaises(test.TestingException, sut)
 
 
 class TestCoalesceChain(test.TestCase):