test_config: Make update_environ more robust against failures.
This commit is contained in:
parent
d8b0a56fb4
commit
96ef7c9cbb
1 changed files with 4 additions and 2 deletions
|
@ -69,8 +69,10 @@ def _update_environ(updates):
|
|||
def update_environ(**kwargs):
|
||||
revert = {key: os.environ.get(key) for key in kwargs}
|
||||
_update_environ(kwargs)
|
||||
yield
|
||||
_update_environ(revert)
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
_update_environ(revert)
|
||||
|
||||
def test_repository_from_environment():
|
||||
config = config_mod.Config()
|
||||
|
|
Loading…
Reference in a new issue