diff options
author | Dan Prince <dprince@redhat.com> | 2013-01-30 11:15:10 -0500 |
---|---|---|
committer | Dan Prince <dprince@redhat.com> | 2013-01-30 11:30:41 -0500 |
commit | dc99baa33648820b93c90c15bd3562284e8ce4a9 (patch) | |
tree | 0df37d38124b606d47ddbf9487eae86c756cad36 /tests/utils.py | |
parent | c29263c4a81d2e71a3d6e36eb32e5df9d2c8fb05 (diff) | |
download | oslo-dc99baa33648820b93c90c15bd3562284e8ce4a9.tar.gz oslo-dc99baa33648820b93c90c15bd3562284e8ce4a9.tar.xz oslo-dc99baa33648820b93c90c15bd3562284e8ce4a9.zip |
Add _FATAL_EXCEPTION_FORMAT_ERRORS global.
Add a new global variable to control when exception format errors
are fatal.
Also, updates the Oslo test base class to enable fatal exception
format errors.
The motivation for this change is to give projects that use
openstack common a hook to enable exception format checking when
testing.
Change-Id: Id8f4a0946b1614c8e987976b79069532a2e8608f
Diffstat (limited to 'tests/utils.py')
-rw-r--r-- | tests/utils.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/utils.py b/tests/utils.py index f9854ca..2d681ae 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -24,6 +24,7 @@ import testtools from openstack.common import cfg from openstack.common.fixture import moxstubout +from openstack.common import exception CONF = cfg.CONF @@ -36,6 +37,13 @@ class BaseTestCase(testtools.TestCase): self.addCleanup(CONF.reset) self.useFixture(fixtures.FakeLogger('openstack.common')) self.useFixture(fixtures.Timeout(30, True)) + self.stubs.Set(exception, '_FATAL_EXCEPTION_FORMAT_ERRORS', True) + + def tearDown(self): + super(BaseTestCase, self).tearDown() + CONF.reset() + self.stubs.UnsetAll() + self.stubs.SmartUnsetAll() def config(self, **kw): """ |