PyXR

c:\python24\lib \ test \ test_bsddb3.py



0001 # Test driver for bsddb package.
0002 """
0003 Run all test cases.
0004 """
0005 import sys
0006 import unittest
0007 from test.test_support import requires, verbose, run_suite
0008 
0009 # When running as a script instead of within the regrtest framework, skip the
0010 # requires test, since it's obvious we want to run them.
0011 if __name__ <> '__main__':
0012     requires('bsddb')
0013 
0014 verbose = False
0015 if 'verbose' in sys.argv:
0016     verbose = True
0017     sys.argv.remove('verbose')
0018 
0019 if 'silent' in sys.argv:  # take care of old flag, just in case
0020     verbose = False
0021     sys.argv.remove('silent')
0022 
0023 
0024 def suite():
0025     test_modules = [
0026         'test_associate',
0027         'test_basics',
0028         'test_compat',
0029         'test_dbobj',
0030         'test_dbshelve',
0031         'test_dbtables',
0032         'test_env_close',
0033         'test_get_none',
0034         'test_join',
0035         'test_lock',
0036         'test_misc',
0037         'test_queue',
0038         'test_recno',
0039         'test_thread',
0040         ]
0041 
0042     alltests = unittest.TestSuite()
0043     for name in test_modules:
0044         module = __import__("bsddb.test."+name, globals(), locals(), name)
0045         #print module,name
0046         alltests.addTest(module.test_suite())
0047     return alltests
0048 
0049 
0050 # For invocation through regrtest
0051 def test_main():
0052     tests = suite()
0053     run_suite(tests)
0054 
0055 
0056 # For invocation as a script
0057 if __name__ == '__main__':
0058     from bsddb import db
0059     print '-=' * 38
0060     print db.DB_VERSION_STRING
0061     print 'bsddb.db.version():   %s' % (db.version(),)
0062     print 'bsddb.db.__version__: %s' % db.__version__
0063     print 'bsddb.db.cvsid:       %s' % db.cvsid
0064     print 'python version:        %s' % sys.version
0065     print '-=' * 38
0066 
0067     unittest.main(defaultTest='suite')
0068 

Generated by PyXR 0.9.4
SourceForge.net Logo