4949from easybuild .framework .easyblock import EasyBlock
5050from easybuild .main import main
5151from 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
5353from easybuild .tools .configobj import ConfigObj
5454from easybuild .tools .environment import modify_env
5555from easybuild .tools .filetools import copy_dir , mkdir , read_file , which
@@ -106,8 +106,8 @@ def setUp(self):
106106 os .close (fd )
107107 self .cwd = os .getcwd ()
108108
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 )
111111
112112 # keep track of original environment/Python search path to restore
113113 self .orig_sys_path = sys .path [:]
@@ -131,17 +131,19 @@ def setUp(self):
131131 if eb_path is not None :
132132 os .environ ['EB_SCRIPT_PATH' ] = eb_path
133133
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+
134141 # make sure no deprecated behaviour is being triggered (unless intended by the test)
135142 self .orig_current_version = eb_build_log .CURRENT_VERSION
136143 self .disallow_deprecated_behaviour ()
137144
138145 init_config ()
139146
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-
145147 import easybuild
146148 # try to import easybuild.easyblocks(.generic) packages
147149 # it's OK if it fails here, but important to import first before fiddling with sys.path
0 commit comments