cic-internal-integration/apps/cic-eth/cic_eth/pytest/fixtures_config.py

30 lines
655 B
Python
Raw Permalink Normal View History

2021-02-01 18:12:51 +01:00
# standard imports
import os
import logging
# external imports
2021-02-01 18:12:51 +01:00
import pytest
import confini
script_dir = os.path.dirname(os.path.realpath(__file__))
root_dir = os.path.dirname(os.path.dirname(script_dir))
logg = logging.getLogger(__name__)
2021-02-01 18:12:51 +01:00
@pytest.fixture(scope='session')
def load_config():
2021-07-08 17:28:04 +02:00
config_dir = os.environ.get('CONFINI_DIR')
if config_dir == None:
config_dir = os.path.join(root_dir, 'config/test')
2021-02-01 18:12:51 +01:00
conf = confini.Config(config_dir, 'CICTEST')
conf.process()
logg.debug('config {}'.format(conf))
return conf
@pytest.fixture(scope='session')
def config(
load_config
):
return load_config