Use fixtures.TempDir directly.
Change-Id: I02e20156af20cfc019262f39e343e3ec1ce06a85
Reviewed-on: https://review.openstack.org/35541
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
diff --git a/tests/test_scheduler.py b/tests/test_scheduler.py
index 3d07c13..b75d5ef 100644
--- a/tests/test_scheduler.py
+++ b/tests/test_scheduler.py
@@ -29,7 +29,6 @@
import socket
import string
import subprocess
-import tempfile
import threading
import time
import urllib
@@ -687,15 +686,14 @@
os.environ.get('OS_STDERR_CAPTURE') == '1'):
stderr = self.useFixture(fixtures.StringStream('stderr')).stream
self.useFixture(fixtures.MonkeyPatch('sys.stderr', stderr))
- self.useFixture(fixtures.NestedTempfile())
if (os.environ.get('OS_LOG_CAPTURE') == 'True' or
os.environ.get('OS_LOG_CAPTURE') == '1'):
self.useFixture(fixtures.FakeLogger(
level=logging.DEBUG,
format='%(asctime)s %(name)-32s '
'%(levelname)-8s %(message)s'))
- tmp_root = tempfile.mkdtemp(dir=os.environ.get("ZUUL_TEST_ROOT",
- '/tmp'))
+ tmp_root = self.useFixture(fixtures.TempDir(
+ rootdir=os.environ.get("ZUUL_TEST_ROOT"))).path
self.test_root = os.path.join(tmp_root, "zuul-test")
self.upstream_root = os.path.join(self.test_root, "upstream")
self.git_root = os.path.join(self.test_root, "git")