[Zodb-checkins] CVS: ZODB4/src/zodb/storage/tests - test_storage_api.py:1.3

Barry Warsaw barry@wooz.org
Wed, 22 Jan 2003 15:53:59 -0500


Update of /cvs-repository/ZODB4/src/zodb/storage/tests
In directory cvs.zope.org:/tmp/cvs-serv28219

Modified Files:
	test_storage_api.py 
Log Message:
Cleanups and forward ports from ZODB 3.2, such as:

check the berkeley_is_available flag before attempting to run the BDB
storage tests.


=== ZODB4/src/zodb/storage/tests/test_storage_api.py 1.2 => 1.3 ===
--- ZODB4/src/zodb/storage/tests/test_storage_api.py:1.2	Wed Dec 25 09:12:20 2002
+++ ZODB4/src/zodb/storage/tests/test_storage_api.py	Wed Jan 22 15:53:57 2003
@@ -1,6 +1,6 @@
 ##############################################################################
 #
-# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
+# Copyright (c) 2001 Zope Corporation and Contributors.
 # All Rights Reserved.
 #
 # This software is subject to the provisions of the Zope Public License,
@@ -12,16 +12,12 @@
 #
 ##############################################################################
 
-try:
-    import bsddb3
-except ImportError:
-    raise RuntimeError, 'BerkeleyDB not available'
-
 # Unit tests for basic storage functionality
 
 import unittest
 from zodb import interfaces
 
+from zodb.storage.base import berkeley_is_available
 from zodb.storage.tests import bdbmixin
 from zodb.storage.tests.basic import BasicStorage
 from zodb.storage.tests.revision import RevisionStorage
@@ -81,9 +77,10 @@
 
 def test_suite():
     suite = unittest.TestSuite()
-    suite.addTest(unittest.makeSuite(FullTest, 'check'))
-    suite.addTest(unittest.makeSuite(FullRecoveryTest, 'check'))
-    suite.addTest(unittest.makeSuite(MinimalTest, 'check'))
+    if berkeley_is_available:
+        suite.addTest(unittest.makeSuite(FullTest, 'check'))
+        suite.addTest(unittest.makeSuite(FullRecoveryTest, 'check'))
+        suite.addTest(unittest.makeSuite(MinimalTest, 'check'))
     return suite