From f758b6bc257776d98a794c42b12a04ad3e478da0 Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Sun, 29 Jun 2008 22:50:59 +0200 Subject: [PATCH] unittests: allow changing the test dir --- test/test_xattr.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/test_xattr.py b/test/test_xattr.py index 1223e2a..35cceff 100644 --- a/test/test_xattr.py +++ b/test/test_xattr.py @@ -8,6 +8,9 @@ import errno import xattr +TEST_DIR = os.environ.get("TESTDIR", ".") + + class xattrTest(unittest.TestCase): USER_ATTR = "user.test" USER_VAL = "abc" @@ -27,13 +30,13 @@ class xattrTest(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