Commit 059cb03c authored by Julien Muchembled's avatar Julien Muchembled

Respect NEO_TESTS_ADAPTER for all tests run by -u

parent 3fbffa00
...@@ -178,9 +178,21 @@ class NeoUnitTestBase(NeoTestBase): ...@@ -178,9 +178,21 @@ class NeoUnitTestBase(NeoTestBase):
self.uuid_dict = {} self.uuid_dict = {}
NeoTestBase.setUp(self) NeoTestBase.setUp(self)
def prepareDatabase(self, number, prefix='test_neo'): def prepareDatabase(self, number, prefix=DB_PREFIX):
""" create empties databases """ """ create empty databases """
setupMySQLdb(['%s%u' % (prefix, i) for i in xrange(number)]) adapter = os.getenv('NEO_TESTS_ADAPTER', 'MySQL')
if adapter == 'MySQL':
setupMySQLdb([prefix + str(i) for i in xrange(number)])
elif adapter == 'SQLite':
temp_dir = getTempDirectory()
for i in xrange(number):
try:
os.remove(os.path.join(temp_dir, 'test_neo%s.sqlite' % i))
except OSError, e:
if e.errno != errno.ENOENT:
raise
else:
assert False, adapter
def getMasterConfiguration(self, cluster='main', master_number=2, def getMasterConfiguration(self, cluster='main', master_number=2,
replicas=2, partitions=1009, uuid=None): replicas=2, partitions=1009, uuid=None):
......
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