From 52e9d13d898e304adb7ff5b48d46bf3d27bf83a7 Mon Sep 17 00:00:00 2001 From: vrde Date: Fri, 19 Feb 2016 00:10:44 +0100 Subject: [PATCH] Use unique db names in tests to allow xdist --- conftest.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/conftest.py b/conftest.py index a6006ac2..2191f73b 100644 --- a/conftest.py +++ b/conftest.py @@ -6,12 +6,16 @@ Tasks: 2. delete test database after running the tests """ +import os + import pytest +DB_NAME = 'bigchain_test_{}'.format(os.getpid()) + config = { 'database': { - 'name': 'bigchain_test' + 'name': DB_NAME }, 'keypair': { 'private': '3i2FDXp87N9ExXSvWxqBAw9EgzoxxGTQNKbtxmWBpTyL', @@ -30,7 +34,7 @@ def restore_config(request, node_config): config_utils.dict_config(node_config) -@pytest.fixture +@pytest.fixture(scope='module') def node_config(): return config