From f1d32dbe9b6f5f2e47853b9969483fa841e451f4 Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Tue, 6 Jun 2017 21:03:33 +0800 Subject: Clean up the changes of os.environ in functional tests Use fixtures to restore the API version changes of os.environ in each functional tests, aims to avoid the following test cases failing in unexpected context. And make sure setUpClass/tearDownClass call super class's corresponding methods first. Change-Id: Ie248fe9d3a9e25f1b076c9f2c363200f29a83817 Closes-Bug: #1696080 --- openstackclient/tests/functional/volume/v3/test_volume.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'openstackclient/tests/functional/volume/v3/test_volume.py') diff --git a/openstackclient/tests/functional/volume/v3/test_volume.py b/openstackclient/tests/functional/volume/v3/test_volume.py index 333826d8..283b830f 100644 --- a/openstackclient/tests/functional/volume/v3/test_volume.py +++ b/openstackclient/tests/functional/volume/v3/test_volume.py @@ -11,13 +11,8 @@ # under the License. from openstackclient.tests.functional.volume.v2 import test_volume as v2 -import os +from openstackclient.tests.functional.volume.v3 import common -class VolumeTests(v2.VolumeTests): +class VolumeTests(common.BaseVolumeTests, v2.VolumeTests): """Functional tests for volume. """ - - @classmethod - def setUpClass(cls): - super(VolumeTests, cls).setUpClass() - os.environ['OS_VOLUME_API_VERSION'] = '3' -- cgit v1.2.1