[Python-checkins] r43450 - in python/branches/sqlite-integration/Lib: db/sqlite/test db/sqlite/test/__init__.py db/sqlite/test/dbapi.py db/sqlite/test/factory.py db/sqlite/test/transactions.py db/sqlite/test/types.py db/sqlite/test/userfunctions.

Georg Brandl g.brandl at gmx.net
Thu Mar 30 20:50:02 CEST 2006


Neal Norwitz wrote:
> On 3/30/06, anthony.baxter <python-checkins at python.org> wrote:
>> Added: python/branches/sqlite-integration/Lib/test/test_sqlite.py
>> ==============================================================================
>> --- (empty file)
>> +++ python/branches/sqlite-integration/Lib/test/test_sqlite.py  Thu Mar 30 13:42:44 2006
>> @@ -0,0 +1,15 @@
>> +import unittest
>> +from db.sqlite.test import (dbapi, types, userfunctions,
>> +                                factory, transactions)
>> +
>> +def suite():
>> +    return unittest.TestSuite(
>> +        (dbapi.suite(), types.suite(), userfunctions.suite(),
>> +         factory.suite(), transactions.suite()))
>> +
>> +def test():
>> +    runner = unittest.TextTestRunner()
>> +    runner.run(suite())
>> +
>> +if __name__ == "__main__":
>> +    test()
> 
> Does this actually run the test?  ISTR the test function needs to be
> called test_main or test on import.

You're right. I don't dare to check it in myself, but this version of the file
conforms with other tests and actually runs the sqlite tests:

"""
from test.test_support import run_unittest, TestSkipped

try:
    import _sqlite
except ImportError:
    raise TestSkipped('no sqlite available')

from db.sqlite.test import dbapi, types, userfunctions, factory, transactions

def test_main():
    run_unittest(dbapi.suite(), types.suite(), userfunctions.suite(),
                 factory.suite(), transactions.suite())

if __name__ == "__main__":
    test_main()
"""

Georg



More information about the Python-checkins mailing list