summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoorul Islam K M <noorul@noorul.com>2013-11-05 12:03:51 +0530
committerNoorul Islam K M <noorul@noorul.com>2013-11-05 12:03:51 +0530
commitf7cd3f8b745fb939e3dcd1de9a0f85f2cfbd26a6 (patch)
tree517677ecc341439daae92452f86c504b19d550fe
parent5d8e1a8cf90a8393de0191bbb2e04c914584e201 (diff)
downloadoslotest-f7cd3f8b745fb939e3dcd1de9a0f85f2cfbd26a6.tar.gz
Add TempHomeDir fixture which is already part of cookiecutter template
TempHomeDir fixture creates a temporary directory and sets it as $HOME in the environment. Also tearDown will remove it and reverts back $HOME value to the previous one. 1. In one of the review comments for https://review.openstack.org/#/c/55111, russellb suggested to add TempHomeDir fixture to test module. 2. Cookiecutter template for OpenStack based projects already has this. Change-Id: I7bd86a9d1e1951e04a632cecb181fc1e2c30f392
-rw-r--r--openstack/common/test.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/openstack/common/test.py b/openstack/common/test.py
index 14ba760..3350599 100644
--- a/openstack/common/test.py
+++ b/openstack/common/test.py
@@ -31,6 +31,7 @@ class BaseTestCase(testtools.TestCase):
self._fake_output()
self.useFixture(fixtures.FakeLogger('openstack.common'))
self.useFixture(fixtures.NestedTempfile())
+ self.useFixture(fixtures.TempHomeDir())
def _set_timeout(self):
test_timeout = os.environ.get('OS_TEST_TIMEOUT', 0)