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