49
49
from easybuild .framework .easyblock import EasyBlock
50
50
from easybuild .main import main
51
51
from easybuild .tools import config
52
- from easybuild .tools .config import GENERAL_CLASS , Singleton , module_classes , update_build_option
52
+ from easybuild .tools .config import GENERAL_CLASS , Singleton , module_classes
53
53
from easybuild .tools .configobj import ConfigObj
54
54
from easybuild .tools .environment import modify_env
55
55
from easybuild .tools .filetools import copy_dir , mkdir , read_file , which
@@ -106,8 +106,8 @@ def setUp(self):
106
106
os .close (fd )
107
107
self .cwd = os .getcwd ()
108
108
109
- # keep track of original environment to restore
110
- self .orig_environ = copy .deepcopy (os .environ )
109
+ # keep track of original environment to restore after tests
110
+ self ._initial_environ = copy .deepcopy (os .environ )
111
111
112
112
# keep track of original environment/Python search path to restore
113
113
self .orig_sys_path = sys .path [:]
@@ -131,17 +131,19 @@ def setUp(self):
131
131
if eb_path is not None :
132
132
os .environ ['EB_SCRIPT_PATH' ] = eb_path
133
133
134
+ # disable progress bars when running the tests,
135
+ # since it messes with test suite progress output when test installations are performed
136
+ os .environ ['EASYBUILD_DISABLE_SHOW_PROGRESS_BAR' ] = '1'
137
+
138
+ # Store the environment as setup (including the above paths) for tests to restore
139
+ self .orig_environ = copy .deepcopy (os .environ )
140
+
134
141
# make sure no deprecated behaviour is being triggered (unless intended by the test)
135
142
self .orig_current_version = eb_build_log .CURRENT_VERSION
136
143
self .disallow_deprecated_behaviour ()
137
144
138
145
init_config ()
139
146
140
- # disable progress bars when running the tests,
141
- # since it messes with test suite progress output when test installations are performed
142
- os .environ ['EASYBUILD_DISABLE_SHOW_PROGRESS_BAR' ] = '1'
143
- update_build_option ('show_progress_bar' , False )
144
-
145
147
import easybuild
146
148
# try to import easybuild.easyblocks(.generic) packages
147
149
# it's OK if it fails here, but important to import first before fiddling with sys.path
0 commit comments