2021-02-01 18:12:51 +01:00
|
|
|
# standard imports
|
|
|
|
import os
|
|
|
|
import logging
|
|
|
|
|
2021-06-30 20:15:40 +02:00
|
|
|
# external imports
|
2021-02-01 18:12:51 +01:00
|
|
|
import pytest
|
|
|
|
import confini
|
|
|
|
|
|
|
|
script_dir = os.path.dirname(os.path.realpath(__file__))
|
2021-06-30 20:15:40 +02:00
|
|
|
root_dir = os.path.dirname(os.path.dirname(script_dir))
|
2021-12-22 19:24:05 +01:00
|
|
|
config_dir = os.path.join(root_dir, 'cic_eth', 'data', 'config')
|
2021-06-30 20:15:40 +02:00
|
|
|
logg = logging.getLogger(__name__)
|
2021-02-01 18:12:51 +01:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture(scope='session')
|
|
|
|
def load_config():
|
2021-12-22 19:24:05 +01:00
|
|
|
override_config_dir = os.path.join(root_dir, 'config', 'test')
|
|
|
|
conf = confini.Config(config_dir, 'CICTEST', override_dirs=[override_config_dir])
|
2021-02-01 18:12:51 +01:00
|
|
|
conf.process()
|
|
|
|
logg.debug('config {}'.format(conf))
|
|
|
|
return conf
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture(scope='session')
|
|
|
|
def config(
|
|
|
|
load_config
|
|
|
|
):
|
|
|
|
return load_config
|