mirror of https://github.com/python/cpython
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):
|
||||
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)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
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:
|
||||
|
|
Loading…
Reference in New Issue