File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -630,6 +630,19 @@ def test_prepend_module_path(self):
630630 self .assertEqual (test_path_1 , modulepath [1 ])
631631 self .assertEqual (test_path_0 , modulepath [2 ])
632632
633+ # When prepend fails due to a higher priority path, a warning is shown
634+ self .modtool .unuse (test_path_2 )
635+ self .modtool .prepend_module_path (test_path_0 , priority = 999999 )
636+ self .mock_stderr (True )
637+ self .modtool .prepend_module_path (test_path_2 )
638+ stderr = self .get_stderr ()
639+ self .mock_stderr (False )
640+ self .assertTrue ('could not be prepended' in stderr )
641+ modulepath = curr_module_paths ()
642+ self .assertEqual (test_path_0 , modulepath [0 ])
643+ self .assertEqual (test_path_2 , modulepath [1 ])
644+ self .assertEqual (test_path_1 , modulepath [2 ])
645+
633646 def test_ld_library_path (self ):
634647 """Make sure LD_LIBRARY_PATH is what it should be when loaded multiple modules."""
635648 self .init_testmods ()
You can’t perform that action at this time.
0 commit comments