@@ -3228,7 +3228,7 @@ def test_http_header_fields_urlpat(self):
32283228 mentionhdr = 'Custom HTTP header field set: %s'
32293229 mentionfile = 'File included in parse_http_header_fields_urlpat: %s'
32303230
3231- def run_and_assert (args , _msg , words_expected = None , words_unexpected = None ):
3231+ def run_and_assert (args , words_expected = None , words_unexpected = None ):
32323232 stdout , _stderr = self ._run_mock_eb (args , do_build = True , raise_error = True , testing = False )
32333233 if words_expected is not None :
32343234 self .assert_multi_regex (words_expected , stdout )
@@ -3243,7 +3243,7 @@ def run_and_assert(args, _msg, words_expected=None, words_unexpected=None):
32433243 ])
32443244 # expect to find everything passed on cmdline
32453245 expected = [mentionhdr % (testdohdr ), testdoval , testdonthdr , testdontval ]
3246- run_and_assert (args , "case A" , expected )
3246+ run_and_assert (args , expected )
32473247
32483248 # all subsequent tests share this argument list
32493249 args = common_args
@@ -3259,7 +3259,7 @@ def run_and_assert(args, _msg, words_expected=None, words_unexpected=None):
32593259 # expect to find only the header key (not its value) and only for the appropriate url
32603260 expected = [mentionhdr % testdohdr , mentionfile % testcmdfile ]
32613261 not_expected = [testdoval , testdonthdr , testdontval ]
3262- run_and_assert (args , "case B" , expected , not_expected )
3262+ run_and_assert (args , expected , not_expected )
32633263
32643264 # C: recursion one: header value is another file
32653265 txt = '\n ' .join ([
@@ -3274,7 +3274,7 @@ def run_and_assert(args, _msg, words_expected=None, words_unexpected=None):
32743274 expected = [mentionhdr % (testdohdr ), mentionfile % (testcmdfile ),
32753275 mentionfile % (testincfile ), mentionfile % (testexcfile )]
32763276 not_expected = [testdoval , testdonthdr , testdontval ]
3277- run_and_assert (args , "case C" , expected , not_expected )
3277+ run_and_assert (args , expected , not_expected )
32783278
32793279 # D: recursion two: header field+value is another file,
32803280 write_file (testcmdfile , '\n ' .join ([
@@ -3288,7 +3288,7 @@ def run_and_assert(args, _msg, words_expected=None, words_unexpected=None):
32883288 expected = [mentionhdr % (testdohdr ), mentionfile % (testcmdfile ),
32893289 mentionfile % (testinchdrfile ), mentionfile % (testexchdrfile )]
32903290 not_expected = [testdoval , testdonthdr , testdontval ]
3291- run_and_assert (args , "case D" , expected , not_expected )
3291+ run_and_assert (args , expected , not_expected )
32923292
32933293 # E: recursion three: url pattern + header field + value in another file
32943294 write_file (testcmdfile , '%s\n ' % (testurlpatfile ))
@@ -3301,7 +3301,7 @@ def run_and_assert(args, _msg, words_expected=None, words_unexpected=None):
33013301 # expect to find only the header key (but not the literal filename) and only for the appropriate url
33023302 expected = [mentionhdr % (testdohdr ), mentionfile % (testcmdfile ), mentionfile % (testurlpatfile )]
33033303 not_expected = [testdoval , testdonthdr , testdontval ]
3304- run_and_assert (args , "case E" , expected , not_expected )
3304+ run_and_assert (args , expected , not_expected )
33053305
33063306 # cleanup downloads
33073307 shutil .rmtree (tmpdir )
@@ -5682,6 +5682,23 @@ def test_debug_lmod(self):
56825682 else :
56835683 print ("Skipping test_debug_lmod, requires Lmod as modules tool" )
56845684
5685+ def test_debug_module_cmds (self ):
5686+ """Test use of --debug-module-cmds."""
5687+ patterns = [
5688+ "Output of " ,
5689+ r"os\.env.*EBROOTGCC.*=" ,
5690+ r"os\.env.*PATH.*=" ,
5691+ ]
5692+ for enable in (True , False ):
5693+ with self .subTest (debug_module_cmds = enable ):
5694+ init_config (build_options = {'debug_module_cmds' : enable })
5695+ with self .log_to_testlogfile ():
5696+ self .modtool .load (['GCC/4.6.3' ])
5697+ logtxt = read_file (self .logfile )
5698+ self .assertRegex (logtxt , "Running .*\n .*load GCC/4.6.3" )
5699+ self .assert_multi_regex (patterns , logtxt , assert_true = enable )
5700+ self .modtool .purge ()
5701+
56855702 def test_use_color (self ):
56865703 """Test use_color function."""
56875704 self .assertTrue (use_color ('always' ))
0 commit comments