if 'verbose' in sys
.argv
:
sys
.argv
.remove('verbose')
if 'silent' in sys
.argv
: # take care of old flag, just in case
sys
.argv
.remove('silent')
# For Pythons w/distutils pybsddb
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()
class PrintInfoFakeTest(unittest
.TestCase
):
def testPrintVersions(self
):
# 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.
test_all
.verbose
= verbose
alltests
= unittest
.TestSuite()
for name
in test_modules
:
module
= __import__(name
)
alltests
.addTest(module
.test_suite())
suite
= unittest
.TestSuite()
suite
.addTest(unittest
.makeSuite(PrintInfoFakeTest
))
if __name__
== '__main__':
unittest
.main(defaultTest
='suite')