Skip to content
Snippets Groups Projects
Commit 1a2ae8f1 authored by ulif's avatar ulif
Browse files

Do not require list for get_configparser().

We can build a sensible list of config file locations on-the-fly.
parent f326704e
No related branches found
No related tags found
No related merge requests found
......@@ -46,11 +46,13 @@ def valid_locations():
return result
def get_configparser(path_list):
def get_configparser(path_list=None):
"""Parse `path_list` for config values.
Return a list of paths read and a config parser instance.
"""
if path_list is None:
path_list = []
parser = configparser.SafeConfigParser()
found = parser.read(path_list)
return found, parser
......
......@@ -30,3 +30,8 @@ class TestConfigModule(object):
# we cope with empty config file lists
found, config = get_configparser([])
assert found == []
def test_get_configparser_no_list(self):
# we cope with no list at all
found, config = get_configparser()
assert found == []
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment