]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Depend on discover to fix python2.6 tests
authorThomas Herve <therve@gmail.com>
Thu, 2 May 2013 19:50:01 +0000 (21:50 +0200)
committerThomas Herve <therve@gmail.com>
Thu, 2 May 2013 20:11:48 +0000 (22:11 +0200)
It also fix a failure introduced by using 2.7-specific setUpClass.

Fixes: bug #1175753
Change-Id: I63ba61050602df92c654bd70519947965494df37

heat/tests/test_watch.py
tools/test-requires

index d8dd0d7c3ae3003e85ac86d89c422a34d37e5804..12e1214eba2ce5cee1cad07b08f1dcd1c3038bf1 100644 (file)
@@ -37,9 +37,12 @@ class DummyAction:
 
 
 class WatchRuleTest(HeatTestCase):
+    stack_id = None
 
     @classmethod
-    def setUpClass(cls):
+    def setUpDatabase(cls):
+        if cls.stack_id is not None:
+            return
         # Create a dummy stack in the DB as WatchRule instances
         # must be associated with a stack
         utils.setup_dummy_db()
@@ -58,6 +61,7 @@ class WatchRuleTest(HeatTestCase):
 
     def setUp(self):
         super(WatchRuleTest, self).setUp()
+        self.setUpDatabase()
         self.username = 'watchrule_test_user'
 
         self.ctx = context.get_admin_context()
index 14eba7c29fb3ced63ec62cec2f28723cdb206f9a..d5b09feb77cfc0c3f80445f9c499d0395434ce3a 100644 (file)
@@ -2,6 +2,7 @@
 distribute>=0.6.24
 
 coverage
+discover
 mox==0.5.3
 testrepository>=0.0.13
 paramiko