# HG changeset patch # User Sylvain Thénault # Date 1267005901 -3600 # Node ID 4994901b7379d78c7852bb4f6ef471778abe8a4b # Parent 5f72584ab1d73dceee702facaff406e4c2464f27 don't issue critical message when trying to alter sqlite db during test diff -r 5f72584ab1d7 -r 4994901b7379 server/sources/native.py --- a/server/sources/native.py Wed Feb 24 11:04:28 2010 +0100 +++ b/server/sources/native.py Wed Feb 24 11:05:01 2010 +0100 @@ -421,8 +421,11 @@ # str(query) to avoid error if it's an unicode string cursor.execute(str(query), args) except Exception, ex: - self.critical("sql: %r\n args: %s\ndbms message: %r", - query, args, ex.args[0]) + if self.repo.config.mode != 'test': + # during test we get those message when trying to alter sqlite + # db schema + self.critical("sql: %r\n args: %s\ndbms message: %r", + query, args, ex.args[0]) if rollback: try: session.pool.connection(self.uri).rollback() @@ -443,8 +446,11 @@ # str(query) to avoid error if it's an unicode string cursor.executemany(str(query), args) except Exception, ex: - self.critical("sql many: %r\n args: %s\ndbms message: %r", - query, args, ex.args[0]) + if self.repo.config.mode != 'test': + # during test we get those message when trying to alter sqlite + # db schema + self.critical("sql many: %r\n args: %s\ndbms message: %r", + query, args, ex.args[0]) try: session.pool.connection(self.uri).rollback() self.critical('transaction has been rollbacked')