diff --git a/os_cloud_config/cmd/utils/tests/test_environment.py b/os_cloud_config/cmd/utils/tests/test_environment.py index 317f669..b69e427 100644 --- a/os_cloud_config/cmd/utils/tests/test_environment.py +++ b/os_cloud_config/cmd/utils/tests/test_environment.py @@ -13,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import fixtures import mock import testtools @@ -24,13 +23,6 @@ from os_cloud_config.tests import base class CMDEnviromentTest(base.TestCase): - def setUp(self): - super(CMDEnviromentTest, self).setUp() - for key in ('OS_AUTH_URL', 'OS_PASSWORD', 'OS_TENANT_NAME', - 'OS_USERNAME', 'OS_CACERT'): - fixture = fixtures.EnvironmentVariable(key) - self.useFixture(fixture) - @mock.patch.dict('os.environ', {}) def test_ensure_environment_missing_all(self): message = ("OS_AUTH_URL, OS_PASSWORD, OS_TENANT_NAME, OS_USERNAME " diff --git a/os_cloud_config/tests/base.py b/os_cloud_config/tests/base.py index 6e93268..f8e7060 100644 --- a/os_cloud_config/tests/base.py +++ b/os_cloud_config/tests/base.py @@ -51,3 +51,8 @@ class TestCase(testtools.TestCase): self.useFixture(fixtures.MonkeyPatch('sys.stderr', stderr)) self.log_fixture = self.useFixture(fixtures.FakeLogger()) + + for key in ('OS_AUTH_URL', 'OS_PASSWORD', 'OS_TENANT_NAME', + 'OS_USERNAME', 'OS_CACERT', 'ROOT_DISK'): + fixture = fixtures.EnvironmentVariable(key) + self.useFixture(fixture)