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):
self.uuid_dict = {}
def prepareDatabase(self, number, prefix='test_neo'):
""" create empties databases """
setupMySQLdb(['%s%u' % (prefix, i) for i in xrange(number)])
def prepareDatabase(self, number, prefix=DB_PREFIX):
""" create empty databases """
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):
os.remove(os.path.join(temp_dir, 'test_neo%s.sqlite' % i))
except OSError, e:
if e.errno != errno.ENOENT:
assert False, adapter
def getMasterConfiguration(self, cluster='main', master_number=2,
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