deactivate sqlite connection wrapping for unittest_multisources for now stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 09 Jun 2009 14:46:39 +0200
branchstable
changeset 2072 8008e8812d76
parent 2071 6ebada01a4a1
child 2073 173c646981a7
deactivate sqlite connection wrapping for unittest_multisources for now
server/sources/native.py
server/test/unittest_multisources.py
--- a/server/sources/native.py	Tue Jun 09 14:45:57 2009 +0200
+++ b/server/sources/native.py	Tue Jun 09 14:46:39 2009 +0200
@@ -154,7 +154,10 @@
         self._cache = Cache(repo.config['rql-cache-size'])
         self._temp_table_data = {}
         self._eid_creation_lock = Lock()
-        if self.dbdriver == 'sqlite':
+        # XXX no_sqlite_wrap trick since we've a sqlite locking pb when
+        # running unittest_multisources with the wrapping below
+        if self.dbdriver == 'sqlite' and \
+               not getattr(repo.config, 'no_sqlite_wrap', False):
             from cubicweb.server.sources.extlite import ConnectionWrapper
             self.get_connection = lambda: ConnectionWrapper(self)
             self.check_connection = lambda cnx: cnx
--- a/server/test/unittest_multisources.py	Tue Jun 09 14:45:57 2009 +0200
+++ b/server/test/unittest_multisources.py	Tue Jun 09 14:46:39 2009 +0200
@@ -14,6 +14,8 @@
 from cubicweb.devtools.apptest import RepositoryBasedTC
 from cubicweb.devtools.repotest import do_monkey_patch, undo_monkey_patch
 
+TestServerConfiguration.no_sqlite_wrap = True
+
 class TwoSourcesConfiguration(TestServerConfiguration):
     sourcefile = 'sources_multi'
 
@@ -114,6 +116,7 @@
         cu = cnx.cursor()
         rset = cu.execute('Any X WHERE X has_text "card"')
         self.assertEquals(len(rset), 5, zip(rset.rows, rset.description))
+        cnx.close()
 
     def test_synchronization(self):
         cu = cnx2.cursor()