Set default of database-backend to env var if set

This commit is contained in:
Sylvain Bellemare 2016-12-12 22:23:42 +01:00 committed by Sylvain Bellemare
parent b2c6474d35
commit 2f4ee4d8b9

View File

@ -33,9 +33,12 @@ def pytest_addoption(parser):
from bigchaindb.backend import connection
backends = ', '.join(connection.BACKENDS.keys())
parser.addoption('--database-backend', action='store', default='rethinkdb',
help='Defines the backend to use (available: {})'.format(backends))
parser.addoption(
'--database-backend',
action='store',
default=os.environ.get('BIGCHAINDB_DATABASE_BACKEND', 'rethinkdb'),
help='Defines the backend to use (available: {})'.format(backends),
)
# We need this function to avoid loading an existing