summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_bsddb3.py
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2002-12-30 20:53:18 (GMT)
committerBarry Warsaw <barry@python.org>2002-12-30 20:53:18 (GMT)
commit0a26235e671064ddda5625c1981aa2edf91bb7a8 (patch)
tree2568fa8b4f891acd3debc769d530799731cbec7a /Lib/test/test_bsddb3.py
parentbad8ff089a04372465c3143a3567b9712673c155 (diff)
downloadcpython-0a26235e671064ddda5625c1981aa2edf91bb7a8.zip
cpython-0a26235e671064ddda5625c1981aa2edf91bb7a8.tar.gz
cpython-0a26235e671064ddda5625c1981aa2edf91bb7a8.tar.bz2
Add some missing tests. Should now test everything that pybsddb's
test suite tests.
Diffstat (limited to 'Lib/test/test_bsddb3.py')
-rw-r--r--Lib/test/test_bsddb3.py56
1 files changed, 32 insertions, 24 deletions
diff --git a/Lib/test/test_bsddb3.py b/Lib/test/test_bsddb3.py
index 0b3c665..cd6ccc6 100644
--- a/Lib/test/test_bsddb3.py
+++ b/Lib/test/test_bsddb3.py
@@ -2,58 +2,66 @@
"""
Run all test cases.
"""
-
import sys
import unittest
from test.test_support import requires, verbose, run_suite
-requires('bsddb')
-verbose = 0
+# 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 = 1
+ verbose = True
sys.argv.remove('verbose')
if 'silent' in sys.argv: # take care of old flag, just in case
- verbose = 0
+ verbose = False
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',
- ]
+ 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.suite())
+ #print module,name
+ alltests.addTest(module.test_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 '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' )
+ unittest.main(defaultTest='suite')