Add option to switch backend
This commit is contained in:
parent
6814b06c7b
commit
0a14f97a18
|
@ -29,6 +29,15 @@ USER_PRIVATE_KEY = '8eJ8q9ZQpReWyQT5aFCiwtZ5wDZC4eDnCen88p3tQ6ie'
|
|||
USER_PUBLIC_KEY = 'JEAkEJqLbbgDRAtMm8YAjGp759Aq2qTn9eaEHUj2XePE'
|
||||
|
||||
|
||||
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))
|
||||
|
||||
|
||||
# We need this function to avoid loading an existing
|
||||
# conf file located in the home of the user running
|
||||
# the tests. If it's too aggressive we can change it
|
||||
|
@ -49,8 +58,10 @@ def restore_config(request, node_config):
|
|||
|
||||
|
||||
@pytest.fixture(scope='module')
|
||||
def node_config():
|
||||
return copy.deepcopy(CONFIG)
|
||||
def node_config(request):
|
||||
config = copy.deepcopy(CONFIG)
|
||||
config['database']['backend'] = request.config.getoption('--database-backend')
|
||||
return config
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
|
Loading…
Reference in New Issue