Only modify the connection URL in runs_sql if the original connection

string starts with 'sqlite'.
This commit is contained in:
Dan Prince 2011-04-20 14:01:19 -04:00
parent 896c81209d
commit 47af47787b
1 changed files with 2 additions and 1 deletions

View File

@ -52,7 +52,8 @@ def runs_sql(func):
test_obj = a[0]
orig_sql_connection = test_obj.sql_connection
try:
test_obj.sql_connection = "sqlite:///glance.sqlite"
if orig_sql_connection.startswith('sqlite'):
test_obj.sql_connection = "sqlite:///glance.sqlite"
func(*a, **kwargs)
finally:
test_obj.sql_connection = orig_sql_connection