tests: allow to skip if no database URL

This is needed for certain driver that we may not want to test if
there's no URL provided in the scenario, i.e. no environment variable
can be found.

Change-Id: I0301987885184ce1e2f83c10db99dba70450449a
This commit is contained in:
Julien Danjou
2014-01-06 15:11:30 +01:00
parent dff0102633
commit 7a5b5eb0b1

View File

@@ -33,6 +33,10 @@ from ceilometer.tests import base as test_base
class TestBase(test_base.BaseTestCase):
def setUp(self):
super(TestBase, self).setUp()
if self.database_connection is None:
self.skipTest("No connection URL set")
self.CONF = self.useFixture(config.Config()).conf
self.CONF.set_override('connection', str(self.database_connection),
group='database')