File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -678,7 +678,7 @@ def _is_valid_for_env(m, e):
678678 for p in current_system .partitions :
679679 for e in p .environs :
680680 rt .loadenv (p .local_env , e )
681- modules = ms .available_modules (substr )
681+ modules = OrderedSet ( ms .available_modules (substr ) )
682682 snap0 .restore ()
683683 for m in modules :
684684 if _is_valid_for_env (m , e .name ):
Original file line number Diff line number Diff line change @@ -1450,16 +1450,24 @@ def user_exec_ctx(request, make_exec_ctx_g):
14501450
14511451
14521452@pytest .fixture
1453- def modules_system (user_exec_ctx , monkeypatch ):
1453+ def modules_system (user_exec_ctx , monkeypatch , tmp_path ):
14541454 # Pretend to be on a clean modules environment
14551455 monkeypatch .setenv ('MODULEPATH' , '' )
14561456 monkeypatch .setenv ('LOADEDMODULES' , '' )
14571457 monkeypatch .setenv ('_LMFILES_' , '' )
14581458
1459+ # Create a symlink to testmod_foo to check for unique module names
1460+ # found by `find_modules`
1461+ (tmp_path / 'testmod_foo' ).symlink_to (
1462+ os .path .join (test_util .TEST_MODULES , 'testmod_foo' )
1463+ )
1464+
14591465 ms = rt .runtime ().system .modules_system
1466+ ms .searchpath_add (str (tmp_path ))
14601467 ms .searchpath_add (test_util .TEST_MODULES )
14611468 yield ms
14621469 ms .searchpath_remove (test_util .TEST_MODULES )
1470+ ms .searchpath_remove (str (tmp_path ))
14631471
14641472
14651473def test_find_modules (modules_system ):
You can’t perform that action at this time.
0 commit comments