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,7 +152,9 @@ class ConfigLoader:
|
|||
"""Context manager for unittests to patch a value"""
|
||||
original_value = self.y(path)
|
||||
self.y_set(path, value)
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
self.y_set(path, original_value)
|
||||
|
||||
@property
|
||||
|
|
Reference in New Issue