Commit 49251408 authored by Kirill Smelkov's avatar Kirill Smelkov

tests: Remove test NEO database after test run is over

With NEO we were creating test database on /tmp but we were not deleting
it in the end. As the result many /tmp/neo_XXXXXX non-empty directories
were being leaked.

-> Fix it by creating testdb directory outselves and removing it at the
end, similarly to FileStorage and ZEO.

Fixes: 7fc4ec66 (tests: Allow to test with ZEO & NEO ZODB storages)
parent 45178531
......@@ -292,14 +292,17 @@ class TestDB_NEO(TestDB_Base):
def __init__(self, dburi):
super(TestDB_NEO, self).__init__(dburi)
from neo.tests.functional import NEOCluster
self.cluster = NEOCluster(['1'], adapter='SQLite')
self.NEOCluster = NEOCluster
def setup(self):
self.tmpd = mkdtemp('', 'testdb_neo.')
self.cluster = self.NEOCluster(['1'], temp_dir=self.tmpd, adapter='SQLite')
self.cluster.start()
self.cluster.expectClusterRunning()
def _teardown(self):
self.cluster.stop()
rmtree(self.tmpd)
def getZODBStorage(self):
return self.cluster.getZODBStorage()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment