def pytest_ignore_collect(path, config): from bigchaindb.backend.connection import BACKENDS path = str(path) if os.path.isdir(path): dirname = os.path.split(path)[1] if dirname in BACKENDS.keys() and dirname != config.getoption('--database-backend'): print('Ignoring unrequested backend test dir: ', path) return True
def pytest_addoption(parser): from bigchaindb.backend.connection import BACKENDS backends = ', '.join(BACKENDS.keys()) parser.addoption( '--database-backend', action='store', default=os.environ.get('BIGCHAINDB_DATABASE_BACKEND', 'localmongodb'), help='Defines the backend to use (available: {})'.format(backends), )
def pytest_ignore_collect(path, config): from bigchaindb.backend.connection import BACKENDS path = str(path) BACKENDS[ 'mongodb-ssl'] = 'bigchaindb.backend.mongodb.connection.MongoDBConnection' supported_backends = BACKENDS.keys() if os.path.isdir(path): dirname = os.path.split(path)[1] if dirname in supported_backends and dirname != config.getoption( '--database-backend'): print('Ignoring unrequested backend test dir: ', path) return True