@@ -650,7 +650,6 @@ def test_make_module_req(self):
650650 r'prepend_path\("PATH", pathJoin\(root, "%s"\)\)\n' % sub_path_path , re .M ))
651651
652652 # Module load environement may contain non-path variables
653- # TODO: remove whenever this is properly supported, in the meantime check warning
654653 eb .module_load_environment .NONPATH = {'contents' : 'non_path' , 'var_type' : "STRING" }
655654 eb .module_load_environment .PATH = ['bin' ]
656655 with self .mocked_stdout_stderr ():
@@ -659,16 +658,16 @@ def test_make_module_req(self):
659658 self .assertEqual (list (eb .module_load_environment ), ['PATH' , 'LD_LIBRARY_PATH' , 'NONPATH' ])
660659
661660 if get_module_syntax () == 'Tcl' :
662- self .assertTrue ( re .match (r"^\nprepend-path\s+PATH\s+\$root/bin\n$" , txt , re .M ))
663- self .assertFalse ( re .match ( r"^\nprepend-path\ s+NONPATH\s+\$root/ non_path\n$" , txt , re .M ))
661+ self .assertRegex ( txt , re .compile (r"^\nprepend-path\s+PATH\s+\$root/bin\n" , re .M ))
662+ self .assertRegex ( txt , re .compile ( r'^setenv\ s+NONPATH\s+" non_path"\s*$' , re .M ))
664663 elif get_module_syntax () == 'Lua' :
665- self .assertTrue ( re .match (r'^\nprepend_path\ ("PATH", pathJoin\(root, "bin"\)\)\n$' , txt , re .M ))
666- self .assertFalse ( re .match (r'^\nprepend_path\ ("NONPATH", pathJoin\(root, "non_path"\)\)\n$' , txt , re .M ))
664+ self .assertRegex ( txt , re .compile (r'^prepend_path\ ("PATH", pathJoin\(root, "bin"\)\)$' , re .M ))
665+ self .assertRegex ( txt , re .compile (r'^setenv\ ("NONPATH", "non_path"\)$' , re .M ))
667666 else :
668667 self .fail ("Unknown module syntax: %s" % get_module_syntax ())
669668
670669 logtxt = read_file (eb .logfile )
671- self .assertRegex (logtxt , r"WARNING Non-path variables found in module load env.*NONPATH" )
670+ self .assertNotRegex (logtxt , r"WARNING Non-path variables found in module load env.*NONPATH" )
672671
673672 eb .module_load_environment .remove ('NONPATH' )
674673
0 commit comments