Tests for pure driver are patching cinder.utils.retry globally. All
tests running after test_pure got imported have retry decorator already
mocked. This creates problems when writing new unit tests involving the
decorator. This change unpatches cinder.utils.retry after test_pure
imports pure driver.
Change-Id: Ie9cbe6ffb3cfcaba5a296b5083974696117b99bb
Closes-Bug:
1430699
return f
return _decorator
-mock.patch('cinder.utils.retry', fake_retry).start()
+patch_retry = mock.patch('cinder.utils.retry', fake_retry)
+patch_retry.start()
sys.modules['purestorage'] = mock.Mock()
from cinder.volume.drivers import pure
+# Only mock utils.retry for cinder.volume.drivers.pure import
+patch_retry.stop()
+
DRIVER_PATH = "cinder.volume.drivers.pure"
DRIVER_OBJ = DRIVER_PATH + ".PureISCSIDriver"
ARRAY_OBJ = DRIVER_PATH + ".FlashArray"