|
51 | 51 | from easybuild.tools.build_log import EasyBuildError |
52 | 52 | from easybuild.tools.config import get_module_syntax, get_repositorypath |
53 | 53 | 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 |
55 | 56 | from easybuild.tools.module_generator import ModuleGeneratorTcl |
56 | 57 | from easybuild.tools.modules import Lmod |
57 | 58 | from easybuild.tools.py2vs3 import reload, string_type |
@@ -2851,6 +2852,8 @@ def __exit__(self, type, value, traceback): |
2851 | 2852 | def test_toy_lock_cleanup_signals(self): |
2852 | 2853 | """Test cleanup of locks after EasyBuild session gets a cancellation signal.""" |
2853 | 2854 |
|
| 2855 | + orig_wd = os.getcwd() |
| 2856 | + |
2854 | 2857 | locks_dir = os.path.join(self.test_installpath, 'software', '.locks') |
2855 | 2858 | self.assertFalse(os.path.exists(locks_dir)) |
2856 | 2859 |
|
@@ -2891,6 +2894,9 @@ def __exit__(self, type, value, traceback): |
2891 | 2894 |
|
2892 | 2895 | with wait_and_signal(1, signum): |
2893 | 2896 |
|
| 2897 | + # change back to original working directory before each test |
| 2898 | + change_dir(orig_wd) |
| 2899 | + |
2894 | 2900 | self.mock_stderr(True) |
2895 | 2901 | self.mock_stdout(True) |
2896 | 2902 | self.assertErrorRegex(exc, '.*', self.test_toy_build, ec_file=test_ec, verify=False, |
|
0 commit comments