diff options
author | Harmen Stoppels <harmenstoppels@gmail.com> | 2022-01-12 14:29:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-12 13:29:22 +0000 |
commit | c8e01752a1268ec888cd55d822aaf94d96467f31 (patch) | |
tree | b65a6bc8859ab3b4a346f0bec628566a7e00f38b /lib | |
parent | 640a4f7dcd236fb2658476989ba997922a3d4472 (diff) | |
download | spack-c8e01752a1268ec888cd55d822aaf94d96467f31.tar.gz spack-c8e01752a1268ec888cd55d822aaf94d96467f31.tar.bz2 spack-c8e01752a1268ec888cd55d822aaf94d96467f31.tar.xz spack-c8e01752a1268ec888cd55d822aaf94d96467f31.zip |
Use depends_on over load in lmod module files generated by Spack (#28352)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/test/modules/lmod.py | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/lib/spack/spack/test/modules/lmod.py b/lib/spack/spack/test/modules/lmod.py index 954c068545..a9df8491f7 100644 --- a/lib/spack/spack/test/modules/lmod.py +++ b/lib/spack/spack/test/modules/lmod.py @@ -96,13 +96,7 @@ class TestLmod(object): module_configuration('autoload_direct') content = modulefile_content(mpileaks_spec_string) - assert len([x for x in content if 'if not isloaded(' in x]) == 2 - assert len([x for x in content if 'load(' in x]) == 2 - - # The configuration file doesn't set the verbose keyword - # that defaults to False - messages = [x for x in content if 'LmodMessage("Autoloading' in x] - assert len(messages) == 0 + assert len([x for x in content if 'depends_on(' in x]) == 2 def test_autoload_all(self, modulefile_content, module_configuration): """Tests the automatic loading of all dependencies.""" @@ -110,12 +104,7 @@ class TestLmod(object): module_configuration('autoload_all') content = modulefile_content(mpileaks_spec_string) - assert len([x for x in content if 'if not isloaded(' in x]) == 5 - assert len([x for x in content if 'load(' in x]) == 5 - - # The configuration file sets the verbose keyword to True - messages = [x for x in content if 'LmodMessage("Autoloading' in x] - assert len(messages) == 5 + assert len([x for x in content if 'depends_on(' in x]) == 5 def test_alter_environment(self, modulefile_content, module_configuration): """Tests modifications to run-time environment.""" @@ -158,8 +147,7 @@ class TestLmod(object): module_configuration('blacklist') content = modulefile_content(mpileaks_spec_string) - assert len([x for x in content if 'if not isloaded(' in x]) == 1 - assert len([x for x in content if 'load(' in x]) == 1 + assert len([x for x in content if 'depends_on(' in x]) == 1 def test_no_hash(self, factory, module_configuration): """Makes sure that virtual providers (in the hierarchy) always |