lib: reset settings when error is raised in patch
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
b9294fd9ad
commit
a099b21671
|
@ -152,8 +152,10 @@ class ConfigLoader:
|
||||||
"""Context manager for unittests to patch a value"""
|
"""Context manager for unittests to patch a value"""
|
||||||
original_value = self.y(path)
|
original_value = self.y(path)
|
||||||
self.y_set(path, value)
|
self.y_set(path, value)
|
||||||
yield
|
try:
|
||||||
self.y_set(path, original_value)
|
yield
|
||||||
|
finally:
|
||||||
|
self.y_set(path, original_value)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def raw(self) -> dict:
|
def raw(self) -> dict:
|
||||||
|
|
Reference in New Issue