summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/test_import_legacy.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/test_import_legacy.py b/tests/test_import_legacy.py
index 8a37551d..0c37e808 100644
--- a/tests/test_import_legacy.py
+++ b/tests/test_import_legacy.py
@@ -16,8 +16,10 @@
import os
-import sqlite3
-#import sqlalchemy
+try:
+ import sqlite3 as dbapi
+except ImportError:
+ from pysqlite2 import dbapi2 as dbapi
from keystone.catalog.backends import templated as catalog_templated
from keystone.common.sql import legacy
@@ -52,7 +54,7 @@ class ImportLegacy(test.TestCase):
except OSError:
pass
script_str = open(sql_path).read().strip()
- conn = sqlite3.connect(db_path)
+ conn = dbapi.connect(db_path)
conn.executescript(script_str)
conn.commit()
return db_path