diff --git a/IPython/parallel/controller/sqlitedb.py b/IPython/parallel/controller/sqlitedb.py index 0a85517..088ca97 100644 --- a/IPython/parallel/controller/sqlitedb.py +++ b/IPython/parallel/controller/sqlitedb.py @@ -226,15 +226,16 @@ class SQLiteDB(BaseDB): # isolation_level = None)#, cached_statements=64) # print dir(self._db) - first_table = self.table + first_table = previous_table = self.table i=0 while not self._check_table(): i+=1 self.table = first_table+'_%i'%i self.log.warn( "Table %s exists and doesn't match db format, trying %s"% - (first_table,self.table) + (previous_table, self.table) ) + previous_table = self.table self._db.execute("""CREATE TABLE IF NOT EXISTS %s (msg_id text PRIMARY KEY, diff --git a/IPython/parallel/tests/test_db.py b/IPython/parallel/tests/test_db.py index 90a3902..01cc523 100644 --- a/IPython/parallel/tests/test_db.py +++ b/IPython/parallel/tests/test_db.py @@ -18,6 +18,7 @@ Authors: from __future__ import division +import logging import os import tempfile import time @@ -226,7 +227,9 @@ class TestSQLiteBackend(TestDictBackend): @dec.skip_without('sqlite3') def create_db(self): location, fname = os.path.split(temp_db) - return SQLiteDB(location=location, fname=fname) + log = logging.getLogger('test') + log.setLevel(logging.CRITICAL) + return SQLiteDB(location=location, fname=fname, log=log) def tearDown(self): self.db._db.close()