Use a file for sqlite in tests, in-memory seems to be seg-faulting

This commit is contained in:
Jake Moshenko 2015-01-30 16:32:37 -05:00
parent 64750e31fc
commit 35ba2a6c1f

View file

@ -1,6 +1,7 @@
import os
from datetime import datetime, timedelta
from tempfile import NamedTemporaryFile
from config import DefaultConfig
@ -13,10 +14,13 @@ class FakeTransaction(object):
pass
TEST_DB_FILE = NamedTemporaryFile(delete=True)
class TestConfig(DefaultConfig):
TESTING = True
DB_URI = os.environ.get('TEST_DATABASE_URI', 'sqlite:///:memory:')
DB_URI = os.environ.get('TEST_DATABASE_URI', 'sqlite:///{0}'.format(TEST_DB_FILE.name))
DB_CONNECTION_ARGS = {
'threadlocals': True,
'autorollback': True