Make testing much faster by using a save point, rather than recreating the database every test

This commit is contained in:
Joseph Schorr 2014-01-30 20:57:40 -05:00
parent 31ff854031
commit 0833c88065
6 changed files with 129 additions and 24 deletions

View file

@ -12,16 +12,6 @@ logger = logging.getLogger(__name__)
db = app.config['DB_DRIVER'](app.config['DB_NAME'],
**app.config['DB_CONNECTION_ARGS'])
def close_db(exc):
if not db.is_closed():
logger.debug('Disconnecting from database.')
db.close()
app.teardown_request(close_db)
def random_string_generator(length=16):
def random_string():
random = SystemRandom()