diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2002-11-19 17:47:07 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2002-11-19 17:47:07 (GMT) |
commit | 1c6b1a2b4ea38955a3f0514f4709bafd0be96c5e (patch) | |
tree | 1d75385f12cdeda7369e5a2428d33649e6b70380 /Lib/test/test_bsddb3.py | |
parent | a406b58619e3fd8fb26ced18ac64b475a48648d2 (diff) | |
download | cpython-1c6b1a2b4ea38955a3f0514f4709bafd0be96c5e.zip cpython-1c6b1a2b4ea38955a3f0514f4709bafd0be96c5e.tar.gz cpython-1c6b1a2b4ea38955a3f0514f4709bafd0be96c5e.tar.bz2 |
Importing test suite from bsddb3 3.4.0 (with modifications).
Diffstat (limited to 'Lib/test/test_bsddb3.py')
-rw-r--r-- | Lib/test/test_bsddb3.py | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/Lib/test/test_bsddb3.py b/Lib/test/test_bsddb3.py new file mode 100644 index 0000000..a42238d --- /dev/null +++ b/Lib/test/test_bsddb3.py @@ -0,0 +1,60 @@ +# Test driver for bsddb package. +""" +Run all test cases. +""" + +import sys +import unittest +from test.test_support import requires, verbose, run_suite +requires('bsddb') + +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 suite(): + test_modules = [ 'test_compat', + 'test_basics', + 'test_misc', + 'test_dbobj', + 'test_recno', + 'test_queue', + 'test_get_none', + 'test_dbshelve', + 'test_dbtables', + 'test_thread', + 'test_lock', + 'test_associate', + ] + + alltests = unittest.TestSuite() + for name in test_modules: + module = __import__("bsddb.test."+name, globals(), locals(), name) + print module,name + alltests.addTest(module.suite()) + return alltests + +# For invocation through regrtest +def test_main(): + tests = suite() + run_suite(tests) + +# For invocation as a script +if __name__ == '__main__': + from bsddb import db + print '-=' * 38 + print db.DB_VERSION_STRING + print 'bsddb3.db.version(): %s' % (db.version(), ) + print 'bsddb3.db.__version__: %s' % db.__version__ + print 'bsddb3.db.cvsid: %s' % db.cvsid + print 'python version: %s' % sys.version + print '-=' * 38 + + unittest.main( defaultTest='suite' ) + |