[Python-checkins] r61183 - python/trunk/Lib/bsddb/test/test_associate.py python/trunk/Lib/bsddb/test/test_basics.py python/trunk/Lib/bsddb/test/test_compare.py python/trunk/Lib/bsddb/test/test_cursor_pget_bug.py python/trunk/Lib/bsddb/test/test_dbobj.py python/trunk/Lib/bsddb/test/test_dbshelve.py python/trunk/Lib/bsddb/test/test_dbtables.py python/trunk/Lib/bsddb/test/test_env_close.py python/trunk/Lib/bsddb/test/test_join.py python/trunk/Lib/bsddb/test/test_lock.py python/trunk/Lib/bsddb/test/test_misc.py python/trunk/Lib/bsddb/test/test_pickle.py python/trunk/Lib/bsddb/test/test_recno.py python/trunk/Lib/bsddb/test/test_sequence.py python/trunk/Lib/bsddb/test/test_thread.py

gregory.p.smith python-checkins at python.org
Sun Mar 2 21:00:53 CET 2008


Author: gregory.p.smith
Date: Sun Mar  2 21:00:53 2008
New Revision: 61183

Modified:
   python/trunk/Lib/bsddb/test/test_associate.py
   python/trunk/Lib/bsddb/test/test_basics.py
   python/trunk/Lib/bsddb/test/test_compare.py
   python/trunk/Lib/bsddb/test/test_cursor_pget_bug.py
   python/trunk/Lib/bsddb/test/test_dbobj.py
   python/trunk/Lib/bsddb/test/test_dbshelve.py
   python/trunk/Lib/bsddb/test/test_dbtables.py
   python/trunk/Lib/bsddb/test/test_env_close.py
   python/trunk/Lib/bsddb/test/test_join.py
   python/trunk/Lib/bsddb/test/test_lock.py
   python/trunk/Lib/bsddb/test/test_misc.py
   python/trunk/Lib/bsddb/test/test_pickle.py
   python/trunk/Lib/bsddb/test/test_recno.py
   python/trunk/Lib/bsddb/test/test_sequence.py
   python/trunk/Lib/bsddb/test/test_thread.py
Log:
Modify import of test_support so that the code can also be used with a
stand alone distribution of bsddb that includes its own small copy of
test_support for the needed functionality on older pythons.


Modified: python/trunk/Lib/bsddb/test/test_associate.py
==============================================================================
--- python/trunk/Lib/bsddb/test/test_associate.py	(original)
+++ python/trunk/Lib/bsddb/test/test_associate.py	Sun Mar  2 21:00:53 2008
@@ -23,6 +23,11 @@
     # For Python 2.3
     from bsddb import db, dbshelve
 
+try:
+    from bsddb3 import test_support
+except ImportError:
+    from test import test_support
+
 
 #----------------------------------------------------------------------
 
@@ -106,7 +111,6 @@
     def tearDown(self):
         self.env.close()
         self.env = None
-        from test import test_support
         test_support.rmtree(self.homeDir)
 
     def test00_associateDBError(self):

Modified: python/trunk/Lib/bsddb/test/test_basics.py
==============================================================================
--- python/trunk/Lib/bsddb/test/test_basics.py	(original)
+++ python/trunk/Lib/bsddb/test/test_basics.py	Sun Mar  2 21:00:53 2008
@@ -8,7 +8,6 @@
 import string
 import tempfile
 from pprint import pprint
-from test import test_support
 import unittest
 import time
 
@@ -19,6 +18,11 @@
     # For Python 2.3
     from bsddb import db
 
+try:
+    from bsddb3 import test_support
+except ImportError:
+    from test import test_support
+
 from test_all import verbose
 
 DASH = '-'

Modified: python/trunk/Lib/bsddb/test/test_compare.py
==============================================================================
--- python/trunk/Lib/bsddb/test/test_compare.py	(original)
+++ python/trunk/Lib/bsddb/test/test_compare.py	Sun Mar  2 21:00:53 2008
@@ -15,6 +15,11 @@
     # For Python 2.3
     from bsddb import db, dbshelve
 
+try:
+    from bsddb3 import test_support
+except ImportError:
+    from test import test_support
+
 lexical_cmp = cmp
 
 def lowercase_cmp(left, right):
@@ -70,7 +75,6 @@
         if self.env is not None:
             self.env.close ()
             self.env = None
-        from test import test_support
         test_support.rmtree(self.homeDir)
 
     def addDataToDB (self, data):

Modified: python/trunk/Lib/bsddb/test/test_cursor_pget_bug.py
==============================================================================
--- python/trunk/Lib/bsddb/test/test_cursor_pget_bug.py	(original)
+++ python/trunk/Lib/bsddb/test/test_cursor_pget_bug.py	Sun Mar  2 21:00:53 2008
@@ -9,6 +9,11 @@
     # For Python 2.3
     from bsddb import db
 
+try:
+    from bsddb3 import test_support
+except ImportError:
+    from test import test_support
+
 
 #----------------------------------------------------------------------
 
@@ -42,7 +47,6 @@
         del self.secondary_db
         del self.primary_db
         del self.env
-        from test import test_support
         test_support.rmtree(self.homeDir)
 
     def test_pget(self):

Modified: python/trunk/Lib/bsddb/test/test_dbobj.py
==============================================================================
--- python/trunk/Lib/bsddb/test/test_dbobj.py	(original)
+++ python/trunk/Lib/bsddb/test/test_dbobj.py	Sun Mar  2 21:00:53 2008
@@ -10,6 +10,11 @@
     # For Python 2.3
     from bsddb import db, dbobj
 
+try:
+    from bsddb3 import test_support
+except ImportError:
+    from test import test_support
+
 
 #----------------------------------------------------------------------
 
@@ -29,7 +34,6 @@
             del self.db
         if hasattr(self, 'env'):
             del self.env
-        from test import test_support
         test_support.rmtree(self.homeDir)
 
     def test01_both(self):

Modified: python/trunk/Lib/bsddb/test/test_dbshelve.py
==============================================================================
--- python/trunk/Lib/bsddb/test/test_dbshelve.py	(original)
+++ python/trunk/Lib/bsddb/test/test_dbshelve.py	Sun Mar  2 21:00:53 2008
@@ -14,6 +14,11 @@
     # For Python 2.3
     from bsddb import db, dbshelve
 
+try:
+    from bsddb3 import test_support
+except ImportError:
+    from test import test_support
+
 from test_all import verbose
 
 
@@ -262,7 +267,6 @@
 
 
     def tearDown(self):
-        from test import test_support
         test_support.rmtree(self.homeDir)
         self.do_close()
 

Modified: python/trunk/Lib/bsddb/test/test_dbtables.py
==============================================================================
--- python/trunk/Lib/bsddb/test/test_dbtables.py	(original)
+++ python/trunk/Lib/bsddb/test/test_dbtables.py	Sun Mar  2 21:00:53 2008
@@ -39,6 +39,10 @@
     # For Python 2.3
     from bsddb import db, dbtables
 
+try:
+    from bsddb3 import test_support
+except ImportError:
+    from test import test_support
 
 
 #----------------------------------------------------------------------
@@ -57,7 +61,6 @@
 
     def tearDown(self):
         self.tdb.close()
-        from test import test_support
         test_support.rmtree(self.testHomeDir)
 
     def test01(self):

Modified: python/trunk/Lib/bsddb/test/test_env_close.py
==============================================================================
--- python/trunk/Lib/bsddb/test/test_env_close.py	(original)
+++ python/trunk/Lib/bsddb/test/test_env_close.py	Sun Mar  2 21:00:53 2008
@@ -13,6 +13,11 @@
     # For Python 2.3
     from bsddb import db
 
+try:
+    from bsddb3 import test_support
+except ImportError:
+    from test import test_support
+
 from test_all import verbose
 
 # We're going to get warnings in this module about trying to close the db when
@@ -39,7 +44,6 @@
         tempfile.tempdir = None
 
     def tearDown(self):
-        from test import test_support
         test_support.rmtree(self.homeDir)
 
     def test01_close_dbenv_before_db(self):

Modified: python/trunk/Lib/bsddb/test/test_join.py
==============================================================================
--- python/trunk/Lib/bsddb/test/test_join.py	(original)
+++ python/trunk/Lib/bsddb/test/test_join.py	Sun Mar  2 21:00:53 2008
@@ -20,6 +20,10 @@
     # For Python 2.3
     from bsddb import db, dbshelve
 
+try:
+    from bsddb3 import test_support
+except ImportError:
+    from test import test_support
 
 #----------------------------------------------------------------------
 
@@ -56,7 +60,6 @@
 
     def tearDown(self):
         self.env.close()
-        from test import test_support
         test_support.rmtree(self.homeDir)
 
     def test01_join(self):

Modified: python/trunk/Lib/bsddb/test/test_lock.py
==============================================================================
--- python/trunk/Lib/bsddb/test/test_lock.py	(original)
+++ python/trunk/Lib/bsddb/test/test_lock.py	Sun Mar  2 21:00:53 2008
@@ -22,6 +22,11 @@
     # For Python 2.3
     from bsddb import db
 
+try:
+    from bsddb3 import test_support
+except ImportError:
+    from test import test_support
+
 
 #----------------------------------------------------------------------
 
@@ -36,7 +41,6 @@
 
     def tearDown(self):
         self.env.close()
-        from test import test_support
         test_support.rmtree(self.homeDir)
 
 

Modified: python/trunk/Lib/bsddb/test/test_misc.py
==============================================================================
--- python/trunk/Lib/bsddb/test/test_misc.py	(original)
+++ python/trunk/Lib/bsddb/test/test_misc.py	Sun Mar  2 21:00:53 2008
@@ -12,6 +12,11 @@
     # For Python 2.3
     from bsddb import db, dbshelve, hashopen
 
+try:
+    from bsddb3 import test_support
+except ImportError:
+    from test import test_support
+
 #----------------------------------------------------------------------
 
 class MiscTestCase(unittest.TestCase):
@@ -25,7 +30,6 @@
             pass
 
     def tearDown(self):
-        from test import test_support
         test_support.unlink(self.filename)
         test_support.rmtree(self.homeDir)
 

Modified: python/trunk/Lib/bsddb/test/test_pickle.py
==============================================================================
--- python/trunk/Lib/bsddb/test/test_pickle.py	(original)
+++ python/trunk/Lib/bsddb/test/test_pickle.py	Sun Mar  2 21:00:53 2008
@@ -15,6 +15,11 @@
     # For Python 2.3
     from bsddb import db
 
+try:
+    from bsddb3 import test_support
+except ImportError:
+    from test import test_support
+
 
 #----------------------------------------------------------------------
 
@@ -34,7 +39,6 @@
             del self.db
         if hasattr(self, 'env'):
             del self.env
-        from test import test_support
         test_support.rmtree(self.homeDir)
 
     def _base_test_pickle_DBError(self, pickle):

Modified: python/trunk/Lib/bsddb/test/test_recno.py
==============================================================================
--- python/trunk/Lib/bsddb/test/test_recno.py	(original)
+++ python/trunk/Lib/bsddb/test/test_recno.py	Sun Mar  2 21:00:53 2008
@@ -16,6 +16,11 @@
     # For Python 2.3
     from bsddb import db
 
+try:
+    from bsddb3 import test_support
+except ImportError:
+    from test import test_support
+
 letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
 
 
@@ -27,7 +32,6 @@
         self.homeDir = None
 
     def tearDown(self):
-        from test import test_support
         test_support.unlink(self.filename)
         if self.homeDir:
             test_support.rmtree(self.homeDir)

Modified: python/trunk/Lib/bsddb/test/test_sequence.py
==============================================================================
--- python/trunk/Lib/bsddb/test/test_sequence.py	(original)
+++ python/trunk/Lib/bsddb/test/test_sequence.py	Sun Mar  2 21:00:53 2008
@@ -8,6 +8,11 @@
 except ImportError:
     from bsddb import db
 
+try:
+    from bsddb3 import test_support
+except ImportError:
+    from test import test_support
+
 
 class DBSequenceTest(unittest.TestCase):
     def setUp(self):
@@ -37,7 +42,6 @@
             self.dbenv.close()
             del self.dbenv
 
-        from test import test_support
         test_support.rmtree(self.homeDir)
 
     def test_get(self):

Modified: python/trunk/Lib/bsddb/test/test_thread.py
==============================================================================
--- python/trunk/Lib/bsddb/test/test_thread.py	(original)
+++ python/trunk/Lib/bsddb/test/test_thread.py	Sun Mar  2 21:00:53 2008
@@ -38,6 +38,11 @@
     # For Python 2.3
     from bsddb import db, dbutils
 
+try:
+    from bsddb3 import test_support
+except ImportError:
+    from test import test_support
+
 
 #----------------------------------------------------------------------
 
@@ -68,7 +73,6 @@
         self.d.open(self.filename, self.dbtype, self.dbopenflags|db.DB_CREATE)
 
     def tearDown(self):
-        from test import test_support
         test_support.rmtree(self.homeDir)
         self.d.close()
         self.env.close()


More information about the Python-checkins mailing list