##// END OF EJS Templates
fix message when trying new table due to mismatch in SQLiteDB...
MinRK -
Show More
@@ -226,15 +226,16 b' class SQLiteDB(BaseDB):'
226 226 # isolation_level = None)#,
227 227 cached_statements=64)
228 228 # print dir(self._db)
229 first_table = self.table
229 first_table = previous_table = self.table
230 230 i=0
231 231 while not self._check_table():
232 232 i+=1
233 233 self.table = first_table+'_%i'%i
234 234 self.log.warn(
235 235 "Table %s exists and doesn't match db format, trying %s"%
236 (first_table,self.table)
236 (previous_table, self.table)
237 237 )
238 previous_table = self.table
238 239
239 240 self._db.execute("""CREATE TABLE IF NOT EXISTS %s
240 241 (msg_id text PRIMARY KEY,
@@ -18,6 +18,7 b' Authors:'
18 18
19 19 from __future__ import division
20 20
21 import logging
21 22 import os
22 23 import tempfile
23 24 import time
@@ -226,7 +227,9 b' class TestSQLiteBackend(TestDictBackend):'
226 227 @dec.skip_without('sqlite3')
227 228 def create_db(self):
228 229 location, fname = os.path.split(temp_db)
229 return SQLiteDB(location=location, fname=fname)
230 log = logging.getLogger('test')
231 log.setLevel(logging.CRITICAL)
232 return SQLiteDB(location=location, fname=fname, log=log)
230 233
231 234 def tearDown(self):
232 235 self.db._db.close()
General Comments 0
You need to be logged in to leave comments. Login now