def initDB(): pydo.initAlias('littlewiki', 'sqlite3', 'littlewiki.db') if not os.path.exists('littlewiki.db'): conn=pydo.getConnection('littlewiki') cursor=conn.cursor() cursor.execute(CREATE_SQL) conn.commit()
def initDB(): pydo.initAlias('fumanchu', 'sqlite3', dict(database='hit.db'), pool=False) if not os.path.exists('hit.db'): create_sql="CREATE TABLE hits (id INTEGER NOT NULL PRIMARY KEY, hit_at TIMESTAMP, remote_ip VARCHAR(15))" dbi=pydo.getConnection('fumanchu') c=dbi.cursor() c.execute(create_sql) c.close() dbi.commit()
from pydo import initAlias, delAlias, setLogLevel setLogLevel(logging.DEBUG) # import the actual tests from test_base import * from test_dbi import * from test_dbtypes import * from test_fields import * from test_multifetch import * from test_operators import * if __name__ == '__main__': drivers, tags, pat = config.readCmdLine(sys.argv[1:]) res = 0 import runtests for d, connectArgs in drivers.iteritems(): initAlias(**connectArgs) curtags = list(tags) + [d] if tags: info("testing with driver: %s, tags: %s", d, ", ".join(tags)) else: info("testing with driver: %s", d) config.DRIVER = d try: res |= runModule(runtests, curtags, pat) finally: delAlias('pydotest') del config.DRIVER sys.exit(res)
setLogLevel(logging.DEBUG) # import the actual tests from test_base import * from test_dbi import * from test_dbtypes import * from test_fields import * from test_guesscache import * from test_multifetch import * from test_operators import * if __name__=='__main__': drivers, tags, pat, use_unit=config.readCmdLine(sys.argv[1:]) res=0 import runtests for d, connectArgs in drivers.iteritems(): initAlias(**connectArgs) curtags=list(tags)+[d] if tags: info("testing with driver: %s, tags: %s", d, ", ".join(tags)) else: info("testing with driver: %s", d) config.DRIVER=d try: res |= runModule(runtests, curtags, pat, use_unit) finally: delAlias('pydotest') del config.DRIVER sys.exit(res)
def initDB(driver, connectArgs, pool=None, verbose=False, init=None): pydo.initAlias('pydosessions', driver, connectArgs, pool, verbose, init)