Revision de8fb87d
b/snf-pithos-app/pithos/api/test/__init__.py | ||
---|---|---|
144 | 144 |
prepate_db_connection() |
145 | 145 |
return old_names, mirrors |
146 | 146 |
|
147 |
def teardown_databases(self, old_config, **kwargs): |
|
148 |
from pithos.api.util import _pithos_backend_pool |
|
149 |
_pithos_backend_pool.shutdown() |
|
150 |
super(PithosTestSuiteRunner, self).teardown_databases(old_config, |
|
151 |
**kwargs) |
|
152 |
|
|
147 | 153 |
|
148 | 154 |
class PithosAPITest(TestCase): |
149 | 155 |
def setUp(self): |
b/snf-pithos-backend/pithos/backends/lib/sqlalchemy/dbwrapper.py | ||
---|---|---|
64 | 64 |
|
65 | 65 |
def close(self): |
66 | 66 |
self.conn.close() |
67 |
self.conn = None |
|
67 | 68 |
|
68 | 69 |
def execute(self): |
69 | 70 |
self.trans = self.conn.begin() |
b/snf-pithos-backend/pithos/backends/util.py | ||
---|---|---|
151 | 151 |
backend.messages = [] |
152 | 152 |
return False |
153 | 153 |
|
154 |
def shutdown(self): |
|
155 |
while True: |
|
156 |
backend = self.pool_get(create=False) |
|
157 |
if backend is None: |
|
158 |
break |
|
159 |
self.pool_put(None) |
|
160 |
backend._real_close() |
|
161 |
|
|
154 | 162 |
|
155 | 163 |
def _pooled_backend_close(backend): |
156 | 164 |
backend._pool.pool_put(backend) |
Also available in: Unified diff