diff --git a/tempest/tests/base.py b/tempest/tests/base.py index 15e4311058..f4df3b90eb 100644 --- a/tempest/tests/base.py +++ b/tempest/tests/base.py @@ -12,28 +12,16 @@ # License for the specific language governing permissions and limitations # under the License. -import os - -import fixtures import mock -import testtools -from tempest.openstack.common.fixture import moxstubout +from oslotest import base +from oslotest import moxstubout -class TestCase(testtools.TestCase): +class TestCase(base.BaseTestCase): def setUp(self): super(TestCase, self).setUp() - if (os.environ.get('OS_STDOUT_CAPTURE') == 'True' or - os.environ.get('OS_STDOUT_CAPTURE') == '1'): - stdout = self.useFixture(fixtures.StringStream('stdout')).stream - self.useFixture(fixtures.MonkeyPatch('sys.stdout', stdout)) - if (os.environ.get('OS_STDERR_CAPTURE') == 'True' or - os.environ.get('OS_STDERR_CAPTURE') == '1'): - stderr = self.useFixture(fixtures.StringStream('stderr')).stream - self.useFixture(fixtures.MonkeyPatch('sys.stderr', stderr)) - mox_fixture = self.useFixture(moxstubout.MoxStubout()) self.mox = mox_fixture.mox self.stubs = mox_fixture.stubs diff --git a/tempest/tests/test_auth.py b/tempest/tests/test_auth.py index 03333bef1b..1dcddad87b 100644 --- a/tempest/tests/test_auth.py +++ b/tempest/tests/test_auth.py @@ -16,11 +16,12 @@ import copy import datetime +from oslotest import mockpatch + from tempest import auth from tempest.common import http from tempest import config from tempest import exceptions -from tempest.openstack.common.fixture import mockpatch from tempest.tests import base from tempest.tests import fake_auth_provider from tempest.tests import fake_config diff --git a/tempest/tests/test_decorators.py b/tempest/tests/test_decorators.py index 804204a35d..6b678f790a 100644 --- a/tempest/tests/test_decorators.py +++ b/tempest/tests/test_decorators.py @@ -14,13 +14,12 @@ import mock -import testtools - from oslo.config import cfg +from oslotest import mockpatch +import testtools from tempest import config from tempest import exceptions -from tempest.openstack.common.fixture import mockpatch from tempest import test from tempest.tests import base from tempest.tests import fake_config diff --git a/tempest/tests/test_rest_client.py b/tempest/tests/test_rest_client.py index 64ad3bcf98..d20520cf66 100644 --- a/tempest/tests/test_rest_client.py +++ b/tempest/tests/test_rest_client.py @@ -15,11 +15,12 @@ import httplib2 import json +from oslotest import mockpatch + from tempest.common import rest_client from tempest.common import xml_utils as xml from tempest import config from tempest import exceptions -from tempest.openstack.common.fixture import mockpatch from tempest.tests import base from tempest.tests import fake_auth_provider from tempest.tests import fake_config diff --git a/test-requirements.txt b/test-requirements.txt index 942a7c3e96..b9c75c86f0 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -7,3 +7,4 @@ oslosphinx mox>=0.5.3 mock>=1.0 coverage>=3.6 +oslotest