summaryrefslogtreecommitdiff
path: root/oslo_utils/tests
diff options
context:
space:
mode:
authorChuck Short <chucks@redhat.com>2018-08-22 07:20:31 -0400
committerChuck Short <chucks@redhat.com>2018-08-22 07:21:09 -0400
commit19352892cf16d3af3f4f26f1e15ebb9b54c6bc7b (patch)
tree53270408b6f9a5a47da37bfd16deb935b79d413b /oslo_utils/tests
parente49586e458ca4b673a9f2abbd317c39436bf8d95 (diff)
downloadoslo-utils-19352892cf16d3af3f4f26f1e15ebb9b54c6bc7b.tar.gz
Remove moxstubout usage
As of oslotest version 3.5.0 moxstub will be deprecated, so remove it where it has been used. Change-Id: I9f038428cbea07a307f08c2251eafed7ab8bbea1 Signed-off-by: Chuck Short <chucks@redhat.com>
Diffstat (limited to 'oslo_utils/tests')
-rw-r--r--oslo_utils/tests/test_excutils.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/oslo_utils/tests/test_excutils.py b/oslo_utils/tests/test_excutils.py
index 8e2650e..d4555f0 100644
--- a/oslo_utils/tests/test_excutils.py
+++ b/oslo_utils/tests/test_excutils.py
@@ -13,8 +13,8 @@
# under the License.
import logging
-import time
+import fixtures
import mock
from oslotest import base as test_base
from oslotest import moxstubout
@@ -170,7 +170,6 @@ class ForeverRetryUncaughtExceptionsTest(test_base.BaseTestCase):
super(ForeverRetryUncaughtExceptionsTest, self).setUp()
moxfixture = self.useFixture(moxstubout.MoxStubout())
self.mox = moxfixture.mox
- self.stubs = moxfixture.stubs
@excutils.forever_retry_uncaught_exceptions
def exception_generator(self):
@@ -186,7 +185,10 @@ class ForeverRetryUncaughtExceptionsTest(test_base.BaseTestCase):
pass
def exc_retrier_common_start(self):
- self.stubs.Set(time, 'sleep', self.my_time_sleep)
+ patch_time = fixtures.MockPatch(
+ 'time.sleep', self.my_time_sleep)
+ self.useFixture(patch_time)
+
self.mox.StubOutWithMock(logging, 'exception')
self.mox.StubOutWithMock(timeutils, 'now',
use_mock_anything=True)
@@ -211,7 +213,6 @@ class ForeverRetryUncaughtExceptionsTest(test_base.BaseTestCase):
self.exception_to_raise().AndReturn(None)
self.mox.ReplayAll()
self.exception_generator()
- self.addCleanup(self.stubs.UnsetAll)
def test_exc_retrier_1exc_gives_1log(self):
self.exc_retrier_common_start()