Skip to content

Commit 4b556af

Browse files
committed
Introduce context manager for restoring environment in tests
Many tests modify the environment in some steps and need to restore it afterwards. To avoid missing this the contextmanager does that automatically.
1 parent 6226929 commit 4b556af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/framework/easyblock.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2640,7 +2640,7 @@ def test_extensions_sanity_check(self):
26402640
eb = EB_toy(EasyConfig(self.eb_file))
26412641
eb.silent = True
26422642
write_file(os.path.join(eb.installdir, 'any_file'), '')
2643-
with self.mocked_stdout_stderr():
2643+
with self.mocked_stdout_stderr(), self.saved_env():
26442644
eb.sanity_check_step()
26452645
logtxt = read_file(eb.logfile)
26462646
self.assertRegex(logtxt, 'Running .*command.*echo "toy output"')

0 commit comments

Comments
 (0)