summaryrefslogtreecommitdiffstats
path: root/Lib/bsddb/test/test_all.py
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2002-12-30 20:53:52 (GMT)
committerBarry Warsaw <barry@python.org>2002-12-30 20:53:52 (GMT)
commit9a0d779c7d39ba5f4666eac7c3f913720198e0f8 (patch)
tree1c4c47178b74e5b8564c625d79a940107c217b04 /Lib/bsddb/test/test_all.py
parent0a26235e671064ddda5625c1981aa2edf91bb7a8 (diff)
downloadcpython-9a0d779c7d39ba5f4666eac7c3f913720198e0f8.zip
cpython-9a0d779c7d39ba5f4666eac7c3f913720198e0f8.tar.gz
cpython-9a0d779c7d39ba5f4666eac7c3f913720198e0f8.tar.bz2
Port BerkeleyDB 4.1 support from the pybsddb project. bsddb is now at
version 4.1.1 and works with up to BerkeleyDB 4.1.25.
Diffstat (limited to 'Lib/bsddb/test/test_all.py')
-rw-r--r--Lib/bsddb/test/test_all.py76
1 files changed, 76 insertions, 0 deletions
diff --git a/Lib/bsddb/test/test_all.py b/Lib/bsddb/test/test_all.py
new file mode 100644
index 0000000..15b310f
--- /dev/null
+++ b/Lib/bsddb/test/test_all.py
@@ -0,0 +1,76 @@
+"""Run all test cases.
+"""
+
+import sys
+import os
+import unittest
+
+verbose = 0
+if 'verbose' in sys.argv:
+ verbose = 1
+ sys.argv.remove('verbose')
+
+if 'silent' in sys.argv: # take care of old flag, just in case
+ verbose = 0
+ sys.argv.remove('silent')
+
+
+def print_versions():
+ from bsddb import db
+ print
+ print '-=' * 38
+ print db.DB_VERSION_STRING
+ print 'bsddb.db.version(): %s' % (db.version(), )
+ print 'bsddb.db.__version__: %s' % db.__version__
+ print 'bsddb.db.cvsid: %s' % db.cvsid
+ print 'python version: %s' % sys.version
+ print 'My pid: %s' % os.getpid()
+ print '-=' * 38
+
+
+class PrintInfoFakeTest(unittest.TestCase):
+ def testPrintVersions(self):
+ print_versions()
+
+
+# This little hack is for when this module is run as main and all the
+# other modules import it so they will still be able to get the right
+# verbose setting. It's confusing but it works.
+import test_all
+test_all.verbose = verbose
+
+
+def suite():
+ test_modules = [
+ 'test_associate',
+ 'test_basics',
+ 'test_compat',
+ 'test_dbobj',
+ 'test_dbshelve',
+ 'test_dbtables',
+ 'test_env_close',
+ 'test_get_none',
+ 'test_join',
+ 'test_lock',
+ 'test_misc',
+ 'test_queue',
+ 'test_recno',
+ 'test_thread',
+ ]
+
+ alltests = unittest.TestSuite()
+ for name in test_modules:
+ module = __import__(name)
+ alltests.addTest(module.suite())
+ return alltests
+
+
+def test_suite():
+ suite = unittest.TestSuite()
+ suite.addTest(unittest.makeSuite(PrintInfoFakeTest))
+ return suite
+
+
+if __name__ == '__main__':
+ print_versions()
+ unittest.main(defaultTest='suite')