From ab688a34f37c2ce43b16af9c73058f313bae7780 Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Fri, 27 Jun 2008 21:07:46 +0200 Subject: [PATCH] Allow use of a diferent path for temporary files This patch allows temporary files and directories created during the test to live somewhere else (override with TESTDIR env. var). --- test/test_acls.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/test_acls.py b/test/test_acls.py index 0cf5cca..1a10bf9 100644 --- a/test/test_acls.py +++ b/test/test_acls.py @@ -7,6 +7,8 @@ import tempfile import posix1e +TEST_DIR=os.environ.get("TESTDIR", ".") + class aclTest(unittest.TestCase): """Unittests for ACLs""" @@ -24,13 +26,13 @@ class aclTest(unittest.TestCase): def _getfile(self): """create a temp file""" - fh, fname = tempfile.mkstemp(".test", "xattr-", ".") + fh, fname = tempfile.mkstemp(".test", "xattr-", TEST_DIR) self.rmfiles.append(fname) return fh, fname def _getdir(self): """create a temp dir""" - dname = tempfile.mkdtemp(".test", "xattr-", ".") + dname = tempfile.mkdtemp(".test", "xattr-", TEST_DIR) self.rmdirs.append(dname) return dname -- 2.39.5