mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Add pytest option to switch backend in tests
This commit is contained in:
parent
0a14f97a18
commit
95b353459d
@ -113,7 +113,7 @@ def test_env_config(monkeypatch):
|
|||||||
assert result == expected
|
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 = {
|
file_config = {
|
||||||
'database': {'host': 'test-host'},
|
'database': {'host': 'test-host'},
|
||||||
'backlog_reassign_delay': 5
|
'backlog_reassign_delay': 5
|
||||||
@ -136,7 +136,7 @@ def test_autoconfigure_read_both_from_file_and_env(monkeypatch):
|
|||||||
'threads': None,
|
'threads': None,
|
||||||
},
|
},
|
||||||
'database': {
|
'database': {
|
||||||
'backend': 'rethinkdb',
|
'backend': request.config.getoption('--database-backend'),
|
||||||
'host': 'test-host',
|
'host': 'test-host',
|
||||||
'port': 4242,
|
'port': 4242,
|
||||||
'name': 'test-dbname',
|
'name': 'test-dbname',
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
from collections import namedtuple
|
|
||||||
|
|
||||||
from rethinkdb.ast import RqlQuery
|
from rethinkdb.ast import RqlQuery
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
@ -9,7 +7,7 @@ import pytest
|
|||||||
def config(request, monkeypatch):
|
def config(request, monkeypatch):
|
||||||
config = {
|
config = {
|
||||||
'database': {
|
'database': {
|
||||||
'backend': 'rethinkdb',
|
'backend': request.config.getoption('--database-backend'),
|
||||||
'host': 'host',
|
'host': 'host',
|
||||||
'port': 28015,
|
'port': 28015,
|
||||||
'name': 'bigchain',
|
'name': 'bigchain',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user