[Python-checkins] python/dist/src/Lib/test test_bsddb3.py,1.2,1.3
bwarsaw@users.sourceforge.net
bwarsaw@users.sourceforge.net
Mon, 30 Dec 2002 12:53:20 -0800
Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1:/tmp/cvs-serv509
Modified Files:
test_bsddb3.py
Log Message:
Add some missing tests. Should now test everything that pybsddb's
test suite tests.
Index: test_bsddb3.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_bsddb3.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** test_bsddb3.py 24 Nov 2002 02:35:35 -0000 1.2
--- test_bsddb3.py 30 Dec 2002 20:53:18 -0000 1.3
***************
*** 3,44 ****
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():
--- 3,51 ----
Run all test cases.
"""
import sys
import unittest
from test.test_support import requires, verbose, run_suite
! # When running as a script instead of within the regrtest framework, skip the
! # requires test, since it's obvious we want to run them.
! if __name__ <> '__main__':
! requires('bsddb')
!
! verbose = False
if 'verbose' in sys.argv:
! verbose = True
sys.argv.remove('verbose')
if 'silent' in sys.argv: # take care of old flag, just in case
! verbose = False
sys.argv.remove('silent')
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__("bsddb.test."+name, globals(), locals(), name)
! #print module,name
! alltests.addTest(module.test_suite())
return alltests
+
# For invocation through regrtest
def test_main():
***************
*** 46,49 ****
--- 53,57 ----
run_suite(tests)
+
# For invocation as a script
if __name__ == '__main__':
***************
*** 51,59 ****
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' )
--- 59,67 ----
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 '-=' * 38
! unittest.main(defaultTest='suite')