improve config.py test coverage

This commit is contained in:
Mike Fährmann
2019-11-25 17:19:14 +01:00
parent f5604492c3
commit b5c964332b
2 changed files with 56 additions and 24 deletions

View File

@@ -81,7 +81,7 @@ def get(path, key, default=None, *, conf=_config):
for p in path:
conf = conf[p]
return conf[key]
except KeyError:
except Exception:
return default
@@ -94,7 +94,7 @@ def interpolate(path, key, default=None, *, conf=_config):
conf = conf[p]
if key in conf:
default = conf[key]
except KeyError:
except Exception:
pass
return default
@@ -125,7 +125,7 @@ def unset(path, key, *, conf=_config):
for p in path:
conf = conf[p]
del conf[key]
except KeyError:
except Exception:
pass