From dd2ef6f565e44bbb7f9f7bddf5c73cc0f788aab9 Mon Sep 17 00:00:00 2001 From: gecong1973 Date: Thu, 9 Mar 2017 14:45:42 +0800 Subject: [PATCH] Using fixtures.MockPatch instead of mockpatch.Patch This module has been deprecated in favor of fixtures.MockPatch. Change-Id: Iee59fa82e727e0575e8b6b6afe042231aa8fa5b8 --- oslo_concurrency/tests/unit/test_processutils.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/oslo_concurrency/tests/unit/test_processutils.py b/oslo_concurrency/tests/unit/test_processutils.py index df010a1..33826b2 100644 --- a/oslo_concurrency/tests/unit/test_processutils.py +++ b/oslo_concurrency/tests/unit/test_processutils.py @@ -33,7 +33,6 @@ from oslotest import base as test_base import six from oslo_concurrency import processutils -from oslotest import mockpatch PROCESS_EXECUTION_ERROR_LOGGING_TEST = """#!/bin/bash @@ -284,7 +283,7 @@ grep foo # This test and the one below ensures that when communicate raises # an OSError, we do the right thing(s) def test_exception_on_communicate_error(self): - mock = self.useFixture(mockpatch.Patch( + mock = self.useFixture(fixtures.MockPatch( 'subprocess.Popen.communicate', side_effect=OSError(errno.EAGAIN, 'fake-test'))) @@ -297,7 +296,7 @@ grep foo self.assertEqual(1, mock.mock.call_count) def test_retry_on_communicate_error(self): - mock = self.useFixture(mockpatch.Patch( + mock = self.useFixture(fixtures.MockPatch( 'subprocess.Popen.communicate', side_effect=OSError(errno.EAGAIN, 'fake-test'))) @@ -312,7 +311,7 @@ grep foo def _test_and_check_logging_communicate_errors(self, log_errors=None, attempts=None): - mock = self.useFixture(mockpatch.Patch( + mock = self.useFixture(fixtures.MockPatch( 'subprocess.Popen.communicate', side_effect=OSError(errno.EAGAIN, 'fake-test')))