]> granicus.if.org Git - python/commitdiff
Consistently use tempfile.tempdir for the db_home directory.
authorNeal Norwitz <nnorwitz@gmail.com>
Sat, 26 Jan 2008 23:14:17 +0000 (23:14 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Sat, 26 Jan 2008 23:14:17 +0000 (23:14 +0000)
Lib/bsddb/test/test_associate.py
Lib/bsddb/test/test_compare.py
Lib/bsddb/test/test_cursor_pget_bug.py
Lib/bsddb/test/test_pickle.py
Lib/bsddb/test/test_sequence.py

index ff10cd75f4f99a651eb544242059eb96bf6f5aef..fd70c5d4a082cb574589ce402e71c9e7fb9d2bd1 100644 (file)
@@ -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)
index 59a45ec502a672a07a3727e8d81de3a1e37fccbd..5aa830869b322f3066ceba92e46b0584e2a0398a 100644 (file)
@@ -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)
index de47e6d0463dbadd9dc92e7bc0efd6a93fd4c30f..2f72b1155b2b19a22461202734b466c3069a70a5 100644 (file)
@@ -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:
index 3916e5cb9e68b2004db4172c787eceace7dac934..ef84a4097f88a0fa141a587e8a3e025c53bc109e 100644 (file)
@@ -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
index 979f858c4a04313c7f170b7ba4b872f912a66765..239e8ee13fafe2f7ed8d3b101786401909ad3bab 100644 (file)
@@ -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: