From 334df9fc21dd3e3fc3c8aee2f9c2ad128c9f98ce Mon Sep 17 00:00:00 2001 From: Thomas Herve Date: Thu, 2 May 2013 21:50:01 +0200 Subject: [PATCH] Depend on discover to fix python2.6 tests It also fix a failure introduced by using 2.7-specific setUpClass. Fixes: bug #1175753 Change-Id: I63ba61050602df92c654bd70519947965494df37 --- heat/tests/test_watch.py | 6 +++++- tools/test-requires | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/heat/tests/test_watch.py b/heat/tests/test_watch.py index d8dd0d7c..12e1214e 100644 --- a/heat/tests/test_watch.py +++ b/heat/tests/test_watch.py @@ -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() diff --git a/tools/test-requires b/tools/test-requires index 14eba7c2..d5b09feb 100644 --- a/tools/test-requires +++ b/tools/test-requires @@ -2,6 +2,7 @@ distribute>=0.6.24 coverage +discover mox==0.5.3 testrepository>=0.0.13 paramiko -- 2.45.2