From 35ba2a6c1f6a97417bc8d7ff362844d0da50201b Mon Sep 17 00:00:00 2001 From: Jake Moshenko Date: Fri, 30 Jan 2015 16:32:37 -0500 Subject: [PATCH] Use a file for sqlite in tests, in-memory seems to be seg-faulting --- test/testconfig.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/testconfig.py b/test/testconfig.py index 9613f76d2..ce9130cf7 100644 --- a/test/testconfig.py +++ b/test/testconfig.py @@ -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