Kaydet (Commit) 3d785e2c authored tarafından Neal Norwitz's avatar Neal Norwitz

Consistently use tempfile.tempdir for the db_home directory.

üst 7f47d93f
......@@ -151,7 +151,7 @@ class AssociateTestCase(unittest.TestCase):
def setUp(self):
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
try:
os.mkdir(homeDir)
......
......@@ -4,6 +4,7 @@ TestCases for python DB Btree key comparison function.
import sys, os, re
import test_all
import tempfile
from cStringIO import StringIO
import unittest
......@@ -51,7 +52,7 @@ class AbstractBtreeKeyCompareTestCase (unittest.TestCase):
def setUp (self):
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
try:
os.mkdir (homeDir)
......
import unittest
import tempfile
import sys, os, glob
try:
......@@ -16,7 +17,7 @@ class pget_bugTestCase(unittest.TestCase):
db_name = 'test-cursor_pget.db'
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:
os.mkdir(self.homeDir)
except os.error:
......
......@@ -6,6 +6,7 @@ try:
except ImportError:
cPickle = None
import unittest
import tempfile
import glob
try:
......@@ -24,7 +25,7 @@ class pickleTestCase(unittest.TestCase):
db_name = 'test-dbobj.db'
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
try: os.mkdir(homeDir)
except os.error: pass
......
......@@ -16,7 +16,7 @@ from test_all import verbose
class DBSequenceTest(unittest.TestCase):
def setUp(self):
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:
os.mkdir(self.homeDir)
except os.error:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment