Add pytest option to switch backend in tests

This commit is contained in:
vrde 2016-12-09 10:09:59 +01:00 committed by Sylvain Bellemare
parent 0a14f97a18
commit 95b353459d
2 changed files with 3 additions and 5 deletions

View File

@ -113,7 +113,7 @@ def test_env_config(monkeypatch):
assert result == expected
def test_autoconfigure_read_both_from_file_and_env(monkeypatch):
def test_autoconfigure_read_both_from_file_and_env(monkeypatch, request):
file_config = {
'database': {'host': 'test-host'},
'backlog_reassign_delay': 5
@ -136,7 +136,7 @@ def test_autoconfigure_read_both_from_file_and_env(monkeypatch):
'threads': None,
},
'database': {
'backend': 'rethinkdb',
'backend': request.config.getoption('--database-backend'),
'host': 'test-host',
'port': 4242,
'name': 'test-dbname',

View File

@ -1,5 +1,3 @@
from collections import namedtuple
from rethinkdb.ast import RqlQuery
import pytest
@ -9,7 +7,7 @@ import pytest
def config(request, monkeypatch):
config = {
'database': {
'backend': 'rethinkdb',
'backend': request.config.getoption('--database-backend'),
'host': 'host',
'port': 28015,
'name': 'bigchain',