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"""
|
||||
original_value = self.y(path)
|
||||
self.y_set(path, value)
|
||||
yield
|
||||
self.y_set(path, original_value)
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
self.y_set(path, original_value)
|
||||
|
||||
@property
|
||||
def raw(self) -> dict:
|
||||
|
|
Reference in New Issue