From 026b015627453fe5960915215fb3807e1386c2cb Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 4 Feb 2019 00:17:11 -0500 Subject: [PATCH] Allow passing a config path for broker testing in CI --- piker/brokers/config.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/piker/brokers/config.py b/piker/brokers/config.py index 5b1f9e0f..22cbfe9c 100644 --- a/piker/brokers/config.py +++ b/piker/brokers/config.py @@ -12,13 +12,14 @@ _config_dir = click.get_app_dir('piker') _broker_conf_path = path.join(_config_dir, 'brokers.ini') -def load() -> (configparser.ConfigParser, str): +def load(path: str = None) -> (configparser.ConfigParser, str): """Load broker config. """ + path = path or _broker_conf_path config = configparser.ConfigParser() - read = config.read(_broker_conf_path) - log.debug(f"Read config file {_broker_conf_path}") - return config, _broker_conf_path + read = config.read(path) + log.debug(f"Read config file {path}") + return config, path def write(config: configparser.ConfigParser) -> None: