1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-05 20:58:40 +03:00

s4-ldb.python: Use $SELFTEST_PREFIX/tmp as a temporary directory for testing

This way we won't flood /tmp directory with temp files

Autobuild-User: Kamen Mazdrashki <kamenim@samba.org>
Autobuild-Date: Thu Nov 18 23:11:18 CET 2010 on sn-devel-104
This commit is contained in:
Kamen Mazdrashki 2010-11-18 21:42:26 +02:00
parent 05c0bface1
commit ab379ddd51

View File

@ -9,7 +9,12 @@ import ldb
def filename():
return os.tempnam()
import tempfile
try:
dir_prefix = os.path.join(os.environ["SELFTEST_PREFIX"], "tmp")
except KeyError:
dir_prefix = None
return tempfile.mktemp(dir=dir_prefix)
class NoContextTests(unittest.TestCase):