Skip to content

Commit 305651b

Browse files
authored
Merge pull request #8 from neurobat/master
Database always gets instantiated with correct settings
2 parents be29ea4 + 298a199 commit 305651b

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/testing/common/database.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16+
import copy
1617
import os
1718
import sys
1819
import signal
@@ -36,7 +37,7 @@ def __init__(self, **kwargs):
3637
if self.settings.pop('cache_initialized_db', None):
3738
if init_handler:
3839
try:
39-
self.cache = self.target_class()
40+
self.cache = self.target_class(**self.settings)
4041
init_handler(self.cache)
4142
except:
4243
if self.cache:
@@ -46,7 +47,9 @@ def __init__(self, **kwargs):
4647
if self.cache:
4748
self.cache.terminate()
4849
else:
49-
self.cache = self.target_class(auto_start=0)
50+
settings_noautostart = copy.deepcopy(self.settings)
51+
settings_noautostart.update({"autostart": 0})
52+
self.cache = self.target_class(**settings_noautostart)
5053
self.cache.setup()
5154
self.settings['copy_data_from'] = self.cache.get_data_directory()
5255

0 commit comments

Comments
 (0)