From bc6477ab79b8a7ffb9e46dfcf1df92c9c9aa9b2f Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Thu, 8 Jan 2015 14:39:40 -0500 Subject: Use ToggleLazy fixture from oslo.i18n Use the ToggleLazy fixture from oslo.i18n instead of managing the internal flag ourselves. Change-Id: I5d4ec87e84c95050587e436a42727d428ab01408 --- tests/test_vim.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/tests/test_vim.py b/tests/test_vim.py index 4b832bd..0c8aa51 100644 --- a/tests/test_vim.py +++ b/tests/test_vim.py @@ -18,8 +18,8 @@ Unit tests for classes to invoke VMware VI SOAP calls. """ import mock +from oslo_i18n import fixture as i18n_fixture -from oslo import i18n from oslo.vmware._i18n import _ from oslo.vmware import exceptions from oslo.vmware import vim @@ -34,12 +34,7 @@ class VimTest(base.TestCase): patcher = mock.patch('suds.client.Client') self.addCleanup(patcher.stop) self.SudsClientMock = patcher.start() - back_use_lazy = i18n._lazy.USE_LAZY - i18n.enable_lazy() - self.addCleanup(self._restore_use_lazy, back_use_lazy) - - def _restore_use_lazy(self, back_use_lazy): - i18n._lazy.USE_LAZY = back_use_lazy + self.useFixture(i18n_fixture.ToggleLazy(True)) @mock.patch.object(vim.Vim, '__getattr__', autospec=True) def test_service_content(self, getattr_mock): -- cgit v1.2.1