Consistently use tempfile.tempdir for the db_home directory.
This commit is contained in:
parent
7f47d93f52
commit
3d785e2c6a
|
@ -151,7 +151,7 @@ class AssociateTestCase(unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.filename = self.__class__.__name__ + '.db'
|
self.filename = self.__class__.__name__ + '.db'
|
||||||
homeDir = os.path.join(os.path.dirname(sys.argv[0]), 'db_home')
|
homeDir = os.path.join(tempfile.gettempdir(), 'db_home')
|
||||||
self.homeDir = homeDir
|
self.homeDir = homeDir
|
||||||
try:
|
try:
|
||||||
os.mkdir(homeDir)
|
os.mkdir(homeDir)
|
||||||
|
|
|
@ -4,6 +4,7 @@ TestCases for python DB Btree key comparison function.
|
||||||
|
|
||||||
import sys, os, re
|
import sys, os, re
|
||||||
import test_all
|
import test_all
|
||||||
|
import tempfile
|
||||||
from cStringIO import StringIO
|
from cStringIO import StringIO
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
@ -51,7 +52,7 @@ class AbstractBtreeKeyCompareTestCase (unittest.TestCase):
|
||||||
|
|
||||||
def setUp (self):
|
def setUp (self):
|
||||||
self.filename = self.__class__.__name__ + '.db'
|
self.filename = self.__class__.__name__ + '.db'
|
||||||
homeDir = os.path.join (os.path.dirname (sys.argv[0]), 'db_home')
|
homeDir = os.path.join (tempfile.gettempdir(), 'db_home')
|
||||||
self.homeDir = homeDir
|
self.homeDir = homeDir
|
||||||
try:
|
try:
|
||||||
os.mkdir (homeDir)
|
os.mkdir (homeDir)
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import unittest
|
import unittest
|
||||||
|
import tempfile
|
||||||
import sys, os, glob
|
import sys, os, glob
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -16,7 +17,7 @@ class pget_bugTestCase(unittest.TestCase):
|
||||||
db_name = 'test-cursor_pget.db'
|
db_name = 'test-cursor_pget.db'
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.homeDir = os.path.join(os.path.dirname(sys.argv[0]), 'db_home')
|
self.homeDir = os.path.join(tempfile.gettempdir(), 'db_home')
|
||||||
try:
|
try:
|
||||||
os.mkdir(self.homeDir)
|
os.mkdir(self.homeDir)
|
||||||
except os.error:
|
except os.error:
|
||||||
|
|
|
@ -6,6 +6,7 @@ try:
|
||||||
except ImportError:
|
except ImportError:
|
||||||
cPickle = None
|
cPickle = None
|
||||||
import unittest
|
import unittest
|
||||||
|
import tempfile
|
||||||
import glob
|
import glob
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -24,7 +25,7 @@ class pickleTestCase(unittest.TestCase):
|
||||||
db_name = 'test-dbobj.db'
|
db_name = 'test-dbobj.db'
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
homeDir = os.path.join(os.path.dirname(sys.argv[0]), 'db_home')
|
homeDir = os.path.join(tempfile.gettempdir(), 'db_home')
|
||||||
self.homeDir = homeDir
|
self.homeDir = homeDir
|
||||||
try: os.mkdir(homeDir)
|
try: os.mkdir(homeDir)
|
||||||
except os.error: pass
|
except os.error: pass
|
||||||
|
|
|
@ -16,7 +16,7 @@ from test_all import verbose
|
||||||
class DBSequenceTest(unittest.TestCase):
|
class DBSequenceTest(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.int_32_max = 0x100000000
|
self.int_32_max = 0x100000000
|
||||||
self.homeDir = os.path.join(os.path.dirname(sys.argv[0]), 'db_home')
|
self.homeDir = os.path.join(tempfile.gettempdir(), 'db_home')
|
||||||
try:
|
try:
|
||||||
os.mkdir(self.homeDir)
|
os.mkdir(self.homeDir)
|
||||||
except os.error:
|
except os.error:
|
||||||
|
|
Loading…
Reference in New Issue