From 808a5b14fc0bfff8d8c23cb4e1f125ef84de6d91 Mon Sep 17 00:00:00 2001 From: Thomas Bechtold Date: Mon, 21 Aug 2017 11:46:58 +0200 Subject: [PATCH] Remove deprecated oslotest.mockpatch usage It is deprecated[1] and will be removed soon. [1] https://docs.openstack.org/oslotest/latest/reference/api/oslotest.mockpatch.html Change-Id: I06f12724c7e64057f1c5971f4847f878a3f87a51 Closes-Bug: #1712017 --- bilean/tests/common/base.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bilean/tests/common/base.py b/bilean/tests/common/base.py index da8183a..c365fde 100644 --- a/bilean/tests/common/base.py +++ b/bilean/tests/common/base.py @@ -14,7 +14,6 @@ import logging import os import fixtures -from oslotest import mockpatch import testscenarios import testtools @@ -67,12 +66,12 @@ class BileanTestCase(testscenarios.WithScenarios, self.addCleanup(utils.reset_dummy_db) def patchobject(self, obj, attr, **kwargs): - mockfixture = self.useFixture(mockpatch.PatchObject(obj, attr, - **kwargs)) + mockfixture = self.useFixture(fixtures.MockPatchObject(obj, attr, + **kwargs)) return mockfixture.mock # NOTE(pshchelo): this overrides the testtools.TestCase.patch method # that does simple monkey-patching in favor of mock's patching def patch(self, target, **kwargs): - mockfixture = self.useFixture(mockpatch.Patch(target, **kwargs)) + mockfixture = self.useFixture(fixtures.MockPatch(target, **kwargs)) return mockfixture.mock