Skip to content

Commit 3fef34c

Browse files
author
Alan O'Cais
committed
Make sure that path to eb is always found by tests
1 parent 1d502d5 commit 3fef34c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/framework/utilities.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
from easybuild.tools.config import GENERAL_CLASS, Singleton, module_classes
5151
from easybuild.tools.configobj import ConfigObj
5252
from easybuild.tools.environment import modify_env
53-
from easybuild.tools.filetools import copy_dir, mkdir, read_file
53+
from easybuild.tools.filetools import copy_dir, mkdir, read_file, which
5454
from easybuild.tools.modules import curr_module_paths, modules_tool, reset_module_caches
5555
from easybuild.tools.options import CONFIG_ENV_VAR_PREFIX, EasyBuildOptions, set_tmpdir
5656
from easybuild.tools.py2vs3 import reload
@@ -124,6 +124,12 @@ def setUp(self):
124124
# make sure that the tests only pick up easyconfigs provided with the tests
125125
os.environ['EASYBUILD_ROBOT_PATHS'] = os.path.join(testdir, 'easyconfigs', 'test_ecs')
126126

127+
# make sure that the EasyBuild installation is still known even if we purge an EB module
128+
if os.getenv('EB_SCRIPT_PATH') is None:
129+
eb_path = which('eb')
130+
if eb_path is not None:
131+
os.environ['EB_SCRIPT_PATH'] = eb_path
132+
127133
# make sure no deprecated behaviour is being triggered (unless intended by the test)
128134
self.orig_current_version = eb_build_log.CURRENT_VERSION
129135
self.disallow_deprecated_behaviour()

0 commit comments

Comments
 (0)