bundled/webpy/test/webtest.py @ f841259cc87e

Move the individual line comment forms into comments.js.

This *massively* improves performance on large diffs.  For example, the review
page for the changeset where I added CherryPy as a bundled app was 38.7mb
before this changeset.  With this change it is now 13.2mb.
author Steve Losh <steve@stevelosh.com>
date Sat, 27 Mar 2010 13:03:00 -0400
parents 7c9d165e0cd1
children (none)
"""webtest: test utilities.
"""
import sys, os

# adding current directory to path to make sure local modules can be imported
sys.path.insert(0, '.')

from web.test import *
    
def setup_database(dbname, driver=None, pooling=False):
    if dbname == 'sqlite':
        db = web.database(dbn=dbname, db='webpy.db', pooling=pooling, driver=driver)
    elif dbname == 'postgres':
        user = os.getenv('USER')
        db = web.database(dbn=dbname, db='webpy', user=user, pw='', pooling=pooling, driver=driver)
    else:
        db = web.database(dbn=dbname, db='webpy', user='scott', pw='tiger', pooling=pooling, driver=driver)

    db.printing = '-v' in sys.argv
    return db