Skip to content

Commit a6253b6

Browse files
committed
change back to original working directory before each test case in test_toy_lock_cleanup_signals
1 parent b59e7a6 commit a6253b6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/framework/toy_build.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
from easybuild.tools.build_log import EasyBuildError
5252
from easybuild.tools.config import get_module_syntax, get_repositorypath
5353
from easybuild.tools.environment import modify_env
54-
from easybuild.tools.filetools import adjust_permissions, mkdir, read_file, remove_dir, remove_file, which, write_file
54+
from easybuild.tools.filetools import adjust_permissions, change_dir, mkdir, read_file, remove_dir, remove_file
55+
from easybuild.tools.filetools import which, write_file
5556
from easybuild.tools.module_generator import ModuleGeneratorTcl
5657
from easybuild.tools.modules import Lmod
5758
from easybuild.tools.py2vs3 import reload, string_type
@@ -2851,6 +2852,8 @@ def __exit__(self, type, value, traceback):
28512852
def test_toy_lock_cleanup_signals(self):
28522853
"""Test cleanup of locks after EasyBuild session gets a cancellation signal."""
28532854

2855+
orig_wd = os.getcwd()
2856+
28542857
locks_dir = os.path.join(self.test_installpath, 'software', '.locks')
28552858
self.assertFalse(os.path.exists(locks_dir))
28562859

@@ -2891,6 +2894,9 @@ def __exit__(self, type, value, traceback):
28912894

28922895
with wait_and_signal(1, signum):
28932896

2897+
# change back to original working directory before each test
2898+
change_dir(orig_wd)
2899+
28942900
self.mock_stderr(True)
28952901
self.mock_stdout(True)
28962902
self.assertErrorRegex(exc, '.*', self.test_toy_build, ec_file=test_ec, verify=False,

0 commit comments

Comments
 (0)