diff --git a/python/samba/tests/__init__.py b/python/samba/tests/__init__.py index 935a0873303..bc8c185769b 100644 --- a/python/samba/tests/__init__.py +++ b/python/samba/tests/__init__.py @@ -19,6 +19,7 @@ """Samba Python tests.""" import os +import tempfile import ldb import samba from samba import param @@ -254,7 +255,8 @@ class LdbTestCase(TestCase): def setUp(self): super(LdbTestCase, self).setUp() - self.filename = os.tempnam() + self.tempfile = tempfile.NamedTemporaryFile(delete=False) + self.filename = self.tempfile.name self.ldb = samba.Ldb(self.filename) def set_modules(self, modules=[]): diff --git a/selftest/tests.py b/selftest/tests.py index 4cb6e23446c..55c3d0f59f4 100644 --- a/selftest/tests.py +++ b/selftest/tests.py @@ -62,7 +62,7 @@ planpythontestsuite("none", "samba.tests.security", py3_compatible=True) planpythontestsuite("none", "samba.tests.dcerpc.misc", py3_compatible=True) planpythontestsuite("none", "samba.tests.dcerpc.integer") planpythontestsuite("none", "samba.tests.param", py3_compatible=True) -planpythontestsuite("none", "samba.tests.upgrade") +planpythontestsuite("none", "samba.tests.upgrade", py3_compatible=True) planpythontestsuite("none", "samba.tests.core", py3_compatible=True) planpythontestsuite("none", "samba.tests.common") planpythontestsuite("none", "samba.tests.provision", py3_compatible=True)