From 8d7703c86baac6636377bb94e352fca018b1ddd8 Mon Sep 17 00:00:00 2001 From: Yuriy Taraday Date: Tue, 28 May 2013 16:44:51 +0400 Subject: [PATCH] Unset all stubs before running other cleanups. Cleanup callbacks are run in reverse order so all stubs unsetting should be added at the end of the cleanup list. Fixes bug 1185004 Change-Id: I5ad3ea2cdce663aaeae6b7cc2cb9c5dac9d12435 --- cinder/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cinder/test.py b/cinder/test.py index 4db727c9c..e731b6323 100644 --- a/cinder/test.py +++ b/cinder/test.py @@ -100,6 +100,7 @@ class TestCase(testtools.TestCase): # because it screws with our generators self.mox = mox.Mox() self.stubs = stubout.StubOutForTesting() + self.addCleanup(FLAGS.reset) self.addCleanup(self.mox.UnsetStubs) self.addCleanup(self.stubs.UnsetAll) self.addCleanup(self.stubs.SmartUnsetAll) @@ -107,7 +108,6 @@ class TestCase(testtools.TestCase): self.injected = [] self._services = [] FLAGS.set_override('fatal_exception_format_errors', True) - self.addCleanup(FLAGS.reset) def tearDown(self): """Runs after each test method to tear down test environment.""" -- 2.45.2