[devtools] Avoid db_cache collisions and mis-loading
authorChristophe de Vienne <christophe@unlish.com>
Wed, 19 Nov 2014 11:30:18 +0100
changeset 10064 91a8f355c082
parent 10063 335fa90d5ef4
child 10065 8d4266411be5
[devtools] Avoid db_cache collisions and mis-loading This is done by stopping to share the db_cache between TestDataBaseHandler instances It may seem overkill, but is the only way I could get it to work properly. I think the whole db caching code needs some rework to better work with different db handlers. Closes #4601328
devtools/__init__.py
--- a/devtools/__init__.py	Mon Oct 06 12:08:41 2014 +0200
+++ b/devtools/__init__.py	Wed Nov 19 11:30:18 2014 +0100
@@ -292,6 +292,7 @@
 
 class TestDataBaseHandler(object):
     DRIVER = None
+
     db_cache = {}
     explored_glob = set()
 
@@ -535,6 +536,10 @@
 class PostgresTestDataBaseHandler(TestDataBaseHandler):
     DRIVER = 'postgres'
 
+    # Separate db_cache for PG databases, to avoid collisions with sqlite dbs
+    db_cache = {}
+    explored_glob = set()
+
     __CTL = set()
 
     @classmethod