In test_util.py, a program exit is simulated to test
that the error throwing behaviour is accurate.
Unforunately, this also deletes necessary global state
and so all subsequent tests that run and use tempdir
throw the same error.
This patch is a simple fix to restore the global state
at the end of the test.
Change-Id: I62fef46167e47f6af43271e2ce1db30f54857647
assert os.path.exists(temp_dir.temp_dir)
old_debug_mode = util.TempDirectory._KEEP_FOR_DEBUG
+ old_tempdirs = util.TempDirectory.TEMPDIRS
try:
for temp_dir_number in range(0, 3):
with util.TempDirectory.set_keep_for_debug():
finally:
util.TempDirectory.DEBUG_MODE = old_debug_mode
+ util.TempDirectory.TEMPDIRS = old_tempdirs
if __name__ == '__main__':