From 0890ac4507e5568d1d5a5da9bbd3c729238a9b3a Mon Sep 17 00:00:00 2001 From: alalazo Date: Mon, 23 May 2016 10:54:48 +0200 Subject: modules : explicit module file load from configuration files --- lib/spack/spack/config.py | 1 + lib/spack/spack/modules.py | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/spack/spack/config.py b/lib/spack/spack/config.py index ec37bd290c..c3133697f4 100644 --- a/lib/spack/spack/config.py +++ b/lib/spack/spack/config.py @@ -286,6 +286,7 @@ section_schemas = { 'autoload': {'$ref': '#/definitions/dependency_selection'}, 'prerequisites': {'$ref': '#/definitions/dependency_selection'}, 'conflict': {'$ref': '#/definitions/array_of_strings'}, + 'load': {'$ref': '#/definitions/array_of_strings'}, 'environment': { 'type': 'object', 'default': {}, diff --git a/lib/spack/spack/modules.py b/lib/spack/spack/modules.py index d2b819e80a..9fa92a593f 100644 --- a/lib/spack/spack/modules.py +++ b/lib/spack/spack/modules.py @@ -381,6 +381,8 @@ class EnvModule(object): for x in filter_blacklisted( module_configuration.pop('autoload', []), self.name): module_file_content += self.autoload(x) + for x in module_configuration.pop('load', []): + module_file_content += self.autoload(x) for x in filter_blacklisted( module_configuration.pop('prerequisites', []), self.name): module_file_content += self.prerequisite(x) @@ -402,8 +404,12 @@ class EnvModule(object): return tuple() def autoload(self, spec): - m = type(self)(spec) - return self.autoload_format.format(module_file=m.use_name) + if not isinstance(spec, str): + m = type(self)(spec) + module_file = m.use_name + else: + module_file = spec + return self.autoload_format.format(module_file=module_file) def prerequisite(self, spec): m = type(self)(spec) -- cgit v1.2.3-60-g2f50 From 84707ed92631bbc4e1c0a7d5c4f1ba19e8e60192 Mon Sep 17 00:00:00 2001 From: alalazo Date: Tue, 24 May 2016 15:23:52 +0200 Subject: modules : it's possible to add suffixes to module files based on constraint --- lib/spack/spack/config.py | 1 + lib/spack/spack/modules.py | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/spack/spack/config.py b/lib/spack/spack/config.py index c3133697f4..9037c5d796 100644 --- a/lib/spack/spack/config.py +++ b/lib/spack/spack/config.py @@ -287,6 +287,7 @@ section_schemas = { 'prerequisites': {'$ref': '#/definitions/dependency_selection'}, 'conflict': {'$ref': '#/definitions/array_of_strings'}, 'load': {'$ref': '#/definitions/array_of_strings'}, + 'suffixes': {'$ref': '#/definitions/dictionary_of_strings'}, 'environment': { 'type': 'object', 'default': {}, diff --git a/lib/spack/spack/modules.py b/lib/spack/spack/modules.py index 9fa92a593f..fb58be6ce0 100644 --- a/lib/spack/spack/modules.py +++ b/lib/spack/spack/modules.py @@ -285,11 +285,18 @@ class EnvModule(object): naming_tokens = self.tokens naming_scheme = self.naming_scheme name = naming_scheme.format(**naming_tokens) - name += '-' + self.spec.dag_hash( - ) # Always append the hash to make the module file unique # Not everybody is working on linux... parts = name.split('/') name = join_path(*parts) + # Add optional suffixes based on constraints + configuration, _ = parse_config_options(self) + suffixes = [name] + for constraint, suffix in configuration.get('suffixes', {}).items(): + if constraint in self.spec: + suffixes.append(suffix) + # Always append the hash to make the module file unique + suffixes.append(self.spec.dag_hash()) + name = '-'.join(suffixes) return name @property -- cgit v1.2.3-60-g2f50 From 0e71b5dde8fb8c235122b16368cb075a35be9bfb Mon Sep 17 00:00:00 2001 From: alalazo Date: Sat, 4 Jun 2016 10:07:13 +0200 Subject: unit test : update dictionary extending lists --- lib/spack/spack/test/modules.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/lib/spack/spack/test/modules.py b/lib/spack/spack/test/modules.py index c73badf8f2..0465c3e67f 100644 --- a/lib/spack/spack/test/modules.py +++ b/lib/spack/spack/test/modules.py @@ -27,6 +27,7 @@ from contextlib import contextmanager import StringIO import spack.modules +import unittest from spack.test.mock_packages_test import MockPackagesTest FILE_REGISTRY = collections.defaultdict(StringIO.StringIO) @@ -100,6 +101,33 @@ configuration_conflicts = { } } +class HelperFunctionsTests(unittest.TestCase): + def test_update_dictionary_extending_list(self): + target = { + 'foo': { + 'a': 1, + 'b': 2, + 'd': 4 + }, + 'bar': [1, 2, 4], + 'baz': 'foobar' + } + update = { + 'foo': { + 'c': 3, + }, + 'bar': [3], + 'baz': 'foobaz', + 'newkey': { + 'd': 4 + } + } + spack.modules.update_dictionary_extending_lists(target, update) + self.assertTrue(len(target) == 4) + self.assertTrue(len(target['foo']) == 4) + self.assertTrue(len(target['bar']) == 4) + self.assertEqual(target['baz'], 'foobaz') + class TclTests(MockPackagesTest): def setUp(self): -- cgit v1.2.3-60-g2f50 From 2207ab8f23d099f535e95eec6b604862a86e7275 Mon Sep 17 00:00:00 2001 From: alalazo Date: Sat, 4 Jun 2016 10:44:37 +0200 Subject: unit test : inspect_path --- lib/spack/spack/test/modules.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/spack/spack/test/modules.py b/lib/spack/spack/test/modules.py index 0465c3e67f..94d508853c 100644 --- a/lib/spack/spack/test/modules.py +++ b/lib/spack/spack/test/modules.py @@ -101,6 +101,7 @@ configuration_conflicts = { } } + class HelperFunctionsTests(unittest.TestCase): def test_update_dictionary_extending_list(self): target = { @@ -128,6 +129,14 @@ class HelperFunctionsTests(unittest.TestCase): self.assertTrue(len(target['bar']) == 4) self.assertEqual(target['baz'], 'foobaz') + def test_inspect_path(self): + env = spack.modules.inspect_path('/usr') + names = [item.name for item in env] + self.assertTrue('PATH' in names) + self.assertTrue('LIBRARY_PATH' in names) + self.assertTrue('LD_LIBRARY_PATH' in names) + self.assertTrue('CPATH' in names) + class TclTests(MockPackagesTest): def setUp(self): -- cgit v1.2.3-60-g2f50 From 97e28348165d88040fbdc1772c69ae3d06c7378f Mon Sep 17 00:00:00 2001 From: alalazo Date: Sat, 4 Jun 2016 11:20:35 +0200 Subject: unit test : wrong tag for dependencies --- lib/spack/spack/test/modules.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/spack/spack/test/modules.py b/lib/spack/spack/test/modules.py index 94d508853c..9320f6673f 100644 --- a/lib/spack/spack/test/modules.py +++ b/lib/spack/spack/test/modules.py @@ -163,6 +163,7 @@ class TclTests(MockPackagesTest): spec = spack.spec.Spec('mpich@3.0.4 arch=x86-linux') content = self.get_modulefile_content(spec) self.assertTrue('module-whatis "mpich @3.0.4"' in content) + self.assertRaises(TypeError, spack.modules.dependencies, spec, 'non-existing-tag') def test_autoload(self): spack.modules.CONFIGURATION = configuration_autoload_direct -- cgit v1.2.3-60-g2f50 From a3f39c23157cd094d50b3b661be6574cd1814305 Mon Sep 17 00:00:00 2001 From: alalazo Date: Sat, 4 Jun 2016 11:23:23 +0200 Subject: autopep8 : fixed style issues --- lib/spack/spack/test/modules.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/spack/spack/test/modules.py b/lib/spack/spack/test/modules.py index 9320f6673f..d76e0cd054 100644 --- a/lib/spack/spack/test/modules.py +++ b/lib/spack/spack/test/modules.py @@ -103,6 +103,7 @@ configuration_conflicts = { class HelperFunctionsTests(unittest.TestCase): + def test_update_dictionary_extending_list(self): target = { 'foo': { @@ -139,6 +140,7 @@ class HelperFunctionsTests(unittest.TestCase): class TclTests(MockPackagesTest): + def setUp(self): super(TclTests, self).setUp() self.configuration_obj = spack.modules.CONFIGURATION @@ -163,7 +165,8 @@ class TclTests(MockPackagesTest): spec = spack.spec.Spec('mpich@3.0.4 arch=x86-linux') content = self.get_modulefile_content(spec) self.assertTrue('module-whatis "mpich @3.0.4"' in content) - self.assertRaises(TypeError, spack.modules.dependencies, spec, 'non-existing-tag') + self.assertRaises(TypeError, spack.modules.dependencies, + spec, 'non-existing-tag') def test_autoload(self): spack.modules.CONFIGURATION = configuration_autoload_direct -- cgit v1.2.3-60-g2f50 From 408aa10210384490348d997069dce02fe61d336d Mon Sep 17 00:00:00 2001 From: alalazo Date: Sat, 4 Jun 2016 16:18:15 +0200 Subject: unit test : whitelist --- lib/spack/spack/test/modules.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/spack/spack/test/modules.py b/lib/spack/spack/test/modules.py index d76e0cd054..098777c48b 100644 --- a/lib/spack/spack/test/modules.py +++ b/lib/spack/spack/test/modules.py @@ -84,7 +84,8 @@ configuration_alter_environment = { configuration_blacklist = { 'enable': ['tcl'], 'tcl': { - 'blacklist': ['callpath'], + 'whitelist': ['zmpi'], + 'blacklist': ['callpath', 'mpi'], 'all': { 'autoload': 'direct' } @@ -207,6 +208,7 @@ class TclTests(MockPackagesTest): spack.modules.CONFIGURATION = configuration_blacklist spec = spack.spec.Spec('mpileaks arch=x86-linux') content = self.get_modulefile_content(spec) + print('\n'.join(content)) self.assertEqual(len([x for x in content if 'is-loaded' in x]), 1) self.assertEqual(len([x for x in content if 'module load ' in x]), 1) -- cgit v1.2.3-60-g2f50 From 09b1daa7b971eaac221cbd1c043df8f46a38fa33 Mon Sep 17 00:00:00 2001 From: alalazo Date: Sat, 4 Jun 2016 16:23:41 +0200 Subject: unit test : write a blacklisted module --- lib/spack/spack/test/modules.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/spack/spack/test/modules.py b/lib/spack/spack/test/modules.py index 098777c48b..46d6824acd 100644 --- a/lib/spack/spack/test/modules.py +++ b/lib/spack/spack/test/modules.py @@ -211,6 +211,9 @@ class TclTests(MockPackagesTest): print('\n'.join(content)) self.assertEqual(len([x for x in content if 'is-loaded' in x]), 1) self.assertEqual(len([x for x in content if 'module load ' in x]), 1) + spec = spack.spec.Spec('callpath arch=x86-linux') + # Returns a StringIO instead of a string as no module file was written + self.assertRaises(AttributeError, self.get_modulefile_content, spec) def test_conflicts(self): spack.modules.CONFIGURATION = configuration_conflicts -- cgit v1.2.3-60-g2f50 From 422d3d4db60f7e00fdbda452c94bfb5d155f304e Mon Sep 17 00:00:00 2001 From: alalazo Date: Sat, 4 Jun 2016 16:46:15 +0200 Subject: unit test : write a whitelisted module --- lib/spack/spack/test/modules.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/spack/spack/test/modules.py b/lib/spack/spack/test/modules.py index 46d6824acd..7fb1c6a921 100644 --- a/lib/spack/spack/test/modules.py +++ b/lib/spack/spack/test/modules.py @@ -214,6 +214,11 @@ class TclTests(MockPackagesTest): spec = spack.spec.Spec('callpath arch=x86-linux') # Returns a StringIO instead of a string as no module file was written self.assertRaises(AttributeError, self.get_modulefile_content, spec) + spec = spack.spec.Spec('zmpi arch=x86-linux') + content = self.get_modulefile_content(spec) + print('\n'.join(content)) + self.assertEqual(len([x for x in content if 'is-loaded' in x]), 1) + self.assertEqual(len([x for x in content if 'module load ' in x]), 1) def test_conflicts(self): spack.modules.CONFIGURATION = configuration_conflicts -- cgit v1.2.3-60-g2f50 From ffa6fed3a3205d15d6c9ff8ca8c92cbecdbe2a0c Mon Sep 17 00:00:00 2001 From: alalazo Date: Sat, 4 Jun 2016 17:20:06 +0200 Subject: unit test : custom module file load --- lib/spack/spack/test/modules.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/spack/spack/test/modules.py b/lib/spack/spack/test/modules.py index 7fb1c6a921..bf5555d9d4 100644 --- a/lib/spack/spack/test/modules.py +++ b/lib/spack/spack/test/modules.py @@ -75,8 +75,13 @@ configuration_alter_environment = { 'filter': {'environment_blacklist': ['CMAKE_PREFIX_PATH']} }, 'arch=x86-linux': { - 'environment': {'set': {'FOO': 'foo'}, - 'unset': ['BAR']} + 'environment': { + 'set': {'FOO': 'foo'}, + 'unset': ['BAR'] + } + }, + 'arch=x64-linux': { + 'load': ['foo/bar'] } } } @@ -203,6 +208,8 @@ class TclTests(MockPackagesTest): self.assertEqual( len([x for x in content if 'setenv FOO "foo"' in x]), 0) self.assertEqual(len([x for x in content if 'unsetenv BAR' in x]), 0) + self.assertEqual(len([x for x in content if 'is-loaded foo/bar' in x]), 1) + self.assertEqual(len([x for x in content if 'module load foo/bar' in x]), 1) def test_blacklist(self): spack.modules.CONFIGURATION = configuration_blacklist -- cgit v1.2.3-60-g2f50 From 2d6db06fca54aa840593a1dbb4e99e8f0e58bbce Mon Sep 17 00:00:00 2001 From: alalazo Date: Sat, 4 Jun 2016 17:24:27 +0200 Subject: unit test : prerequisites --- lib/spack/spack/test/modules.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/lib/spack/spack/test/modules.py b/lib/spack/spack/test/modules.py index bf5555d9d4..99cc280d27 100644 --- a/lib/spack/spack/test/modules.py +++ b/lib/spack/spack/test/modules.py @@ -68,6 +68,24 @@ configuration_autoload_all = { } } +configuration_prerequisites_direct = { + 'enable': ['tcl'], + 'tcl': { + 'all': { + 'prerequisites': 'direct' + } + } +} + +configuration_prerequisites_all = { + 'enable': ['tcl'], + 'tcl': { + 'all': { + 'prerequisites': 'all' + } + } +} + configuration_alter_environment = { 'enable': ['tcl'], 'tcl': { @@ -187,6 +205,17 @@ class TclTests(MockPackagesTest): self.assertEqual(len([x for x in content if 'is-loaded' in x]), 5) self.assertEqual(len([x for x in content if 'module load ' in x]), 5) + def test_prerequisites(self): + spack.modules.CONFIGURATION = configuration_prerequisites_direct + spec = spack.spec.Spec('mpileaks arch=x86-linux') + content = self.get_modulefile_content(spec) + self.assertEqual(len([x for x in content if 'prereq' in x]), 2) + + spack.modules.CONFIGURATION = configuration_prerequisites_all + spec = spack.spec.Spec('mpileaks arch=x86-linux') + content = self.get_modulefile_content(spec) + self.assertEqual(len([x for x in content if 'prereq' in x]), 5) + def test_alter_environment(self): spack.modules.CONFIGURATION = configuration_alter_environment spec = spack.spec.Spec('mpileaks arch=x86-linux') -- cgit v1.2.3-60-g2f50 From d43cfefa43b47942388003b30ab7fd52b3035fde Mon Sep 17 00:00:00 2001 From: alalazo Date: Sat, 4 Jun 2016 17:24:52 +0200 Subject: autopep8 --- lib/spack/spack/test/modules.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/spack/spack/test/modules.py b/lib/spack/spack/test/modules.py index 99cc280d27..05a3349480 100644 --- a/lib/spack/spack/test/modules.py +++ b/lib/spack/spack/test/modules.py @@ -237,8 +237,10 @@ class TclTests(MockPackagesTest): self.assertEqual( len([x for x in content if 'setenv FOO "foo"' in x]), 0) self.assertEqual(len([x for x in content if 'unsetenv BAR' in x]), 0) - self.assertEqual(len([x for x in content if 'is-loaded foo/bar' in x]), 1) - self.assertEqual(len([x for x in content if 'module load foo/bar' in x]), 1) + self.assertEqual( + len([x for x in content if 'is-loaded foo/bar' in x]), 1) + self.assertEqual( + len([x for x in content if 'module load foo/bar' in x]), 1) def test_blacklist(self): spack.modules.CONFIGURATION = configuration_blacklist -- cgit v1.2.3-60-g2f50 From 669caefccb431a79dcdb1d3743afbac86c84630a Mon Sep 17 00:00:00 2001 From: alalazo Date: Sat, 4 Jun 2016 18:00:18 +0200 Subject: unit test : wrong naming scheme in conflict --- lib/spack/spack/test/modules.py | 52 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/lib/spack/spack/test/modules.py b/lib/spack/spack/test/modules.py index 05a3349480..f695bf75f1 100644 --- a/lib/spack/spack/test/modules.py +++ b/lib/spack/spack/test/modules.py @@ -125,6 +125,16 @@ configuration_conflicts = { } } +configuration_wrong_conflicts = { + 'enable': ['tcl'], + 'tcl': { + 'naming_scheme': '{name}/{version}-{compiler.name}', + 'all': { + 'conflict': ['{name}/{compiler.name}'] + } + } +} + class HelperFunctionsTests(unittest.TestCase): @@ -268,3 +278,45 @@ class TclTests(MockPackagesTest): len([x for x in content if x == 'conflict mpileaks']), 1) self.assertEqual( len([x for x in content if x == 'conflict intel/14.0.1']), 1) + + spack.modules.CONFIGURATION = configuration_wrong_conflicts + self.assertRaises(SystemExit, self.get_modulefile_content, spec) + +configuration_dotkit = { + 'enable': ['dotkit'], + 'dotkit': { + 'all': { + 'prerequisites': 'direct' + } + } +} + + +class DotkitTests(MockPackagesTest): + + def setUp(self): + super(DotkitTests, self).setUp() + self.configuration_obj = spack.modules.CONFIGURATION + spack.modules.open = mock_open + # Make sure that a non-mocked configuration will trigger an error + spack.modules.CONFIGURATION = None + + def tearDown(self): + del spack.modules.open + spack.modules.CONFIGURATION = self.configuration_obj + super(DotkitTests, self).tearDown() + + def get_modulefile_content(self, spec): + spec.concretize() + generator = spack.modules.Dotkit(spec) + generator.write() + content = FILE_REGISTRY[generator.file_name].split('\n') + return content + + def test_dotkit(self): + spack.modules.CONFIGURATION = configuration_dotkit + spec = spack.spec.Spec('mpileaks arch=x86-linux') + content = self.get_modulefile_content(spec) + print('\n'.join(content)) + self.assertTrue('#c spack' in content) + self.assertTrue('#d mpileaks @2.3' in content) -- cgit v1.2.3-60-g2f50 From 02cadb882b60b33a86b2ffc4d3e2320c16e66c7b Mon Sep 17 00:00:00 2001 From: alalazo Date: Sat, 4 Jun 2016 18:09:06 +0200 Subject: unit test : suffixes --- lib/spack/spack/test/modules.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/lib/spack/spack/test/modules.py b/lib/spack/spack/test/modules.py index f695bf75f1..7f4643409e 100644 --- a/lib/spack/spack/test/modules.py +++ b/lib/spack/spack/test/modules.py @@ -135,6 +135,17 @@ configuration_wrong_conflicts = { } } +configuration_suffix = { + 'enable': ['tcl'], + 'tcl': { + 'mpileaks': { + 'suffixes': { + '+debug': 'foo', + '~debug': 'bar' + } + } + } +} class HelperFunctionsTests(unittest.TestCase): @@ -282,6 +293,20 @@ class TclTests(MockPackagesTest): spack.modules.CONFIGURATION = configuration_wrong_conflicts self.assertRaises(SystemExit, self.get_modulefile_content, spec) + + def test_suffixes(self): + spack.modules.CONFIGURATION = configuration_suffix + spec = spack.spec.Spec('mpileaks+debug arch=x86-linux') + spec.concretize() + generator = spack.modules.TclModule(spec) + self.assertTrue('foo' in generator.use_name) + + spec = spack.spec.Spec('mpileaks~debug arch=x86-linux') + spec.concretize() + generator = spack.modules.TclModule(spec) + self.assertTrue('bar' in generator.use_name) + + configuration_dotkit = { 'enable': ['dotkit'], 'dotkit': { -- cgit v1.2.3-60-g2f50 From bdd874eb7fad2e193cb1186a499b9cd742632f62 Mon Sep 17 00:00:00 2001 From: alalazo Date: Sat, 4 Jun 2016 18:09:28 +0200 Subject: autopep8 --- lib/spack/spack/test/modules.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/spack/spack/test/modules.py b/lib/spack/spack/test/modules.py index 7f4643409e..bb83ea9059 100644 --- a/lib/spack/spack/test/modules.py +++ b/lib/spack/spack/test/modules.py @@ -147,6 +147,7 @@ configuration_suffix = { } } + class HelperFunctionsTests(unittest.TestCase): def test_update_dictionary_extending_list(self): @@ -293,7 +294,6 @@ class TclTests(MockPackagesTest): spack.modules.CONFIGURATION = configuration_wrong_conflicts self.assertRaises(SystemExit, self.get_modulefile_content, spec) - def test_suffixes(self): spack.modules.CONFIGURATION = configuration_suffix spec = spack.spec.Spec('mpileaks+debug arch=x86-linux') -- cgit v1.2.3-60-g2f50 From a33077b77fc83bf2cb7e78f0724922fc61137898 Mon Sep 17 00:00:00 2001 From: alalazo Date: Sat, 18 Jun 2016 13:07:14 +0200 Subject: unit tests : fixed test_alter_environment --- lib/spack/spack/test/modules.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/spack/spack/test/modules.py b/lib/spack/spack/test/modules.py index 59ee607826..889c09c730 100644 --- a/lib/spack/spack/test/modules.py +++ b/lib/spack/spack/test/modules.py @@ -93,17 +93,14 @@ configuration_alter_environment = { 'filter': {'environment_blacklist': ['CMAKE_PREFIX_PATH']} }, 'platform=test target=x86_64': { - 'environment': {'set': {'FOO': 'foo'}, - 'unset': ['BAR']} - 'arch=x86-linux': { 'environment': { 'set': {'FOO': 'foo'}, 'unset': ['BAR'] } }, - 'arch=x64-linux': { + 'platform=test target=x86_32': { 'load': ['foo/bar'] - } + } } } @@ -246,7 +243,6 @@ class TclTests(MockPackagesTest): spack.modules.CONFIGURATION = configuration_alter_environment spec = spack.spec.Spec('mpileaks platform=test target=x86_64') content = self.get_modulefile_content(spec) - print content self.assertEqual( len([x for x in content @@ -257,7 +253,6 @@ class TclTests(MockPackagesTest): spec = spack.spec.Spec('libdwarf %clang platform=test target=x86_32') content = self.get_modulefile_content(spec) - print content self.assertEqual( len([x for x in content -- cgit v1.2.3-60-g2f50 From 670669ef808a9a737e760ced8a9fd1d000f360b9 Mon Sep 17 00:00:00 2001 From: alalazo Date: Sat, 18 Jun 2016 13:10:35 +0200 Subject: qa : fixed flake8 issues --- lib/spack/spack/test/modules.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/spack/spack/test/modules.py b/lib/spack/spack/test/modules.py index 889c09c730..443e4d13a6 100644 --- a/lib/spack/spack/test/modules.py +++ b/lib/spack/spack/test/modules.py @@ -100,7 +100,7 @@ configuration_alter_environment = { }, 'platform=test target=x86_32': { 'load': ['foo/bar'] - } + } } } @@ -201,7 +201,6 @@ class TclTests(MockPackagesTest): def get_modulefile_content(self, spec): spec.concretize() - print spec, '&&&&&' generator = spack.modules.TclModule(spec) generator.write() content = FILE_REGISTRY[generator.file_name].split('\n') @@ -269,7 +268,6 @@ class TclTests(MockPackagesTest): spack.modules.CONFIGURATION = configuration_blacklist spec = spack.spec.Spec('mpileaks') content = self.get_modulefile_content(spec) - print('\n'.join(content)) self.assertEqual(len([x for x in content if 'is-loaded' in x]), 1) self.assertEqual(len([x for x in content if 'module load ' in x]), 1) spec = spack.spec.Spec('callpath arch=x86-linux') @@ -277,7 +275,6 @@ class TclTests(MockPackagesTest): self.assertRaises(AttributeError, self.get_modulefile_content, spec) spec = spack.spec.Spec('zmpi arch=x86-linux') content = self.get_modulefile_content(spec) - print('\n'.join(content)) self.assertEqual(len([x for x in content if 'is-loaded' in x]), 1) self.assertEqual(len([x for x in content if 'module load ' in x]), 1) @@ -343,6 +340,5 @@ class DotkitTests(MockPackagesTest): spack.modules.CONFIGURATION = configuration_dotkit spec = spack.spec.Spec('mpileaks arch=x86-linux') content = self.get_modulefile_content(spec) - print('\n'.join(content)) self.assertTrue('#c spack' in content) self.assertTrue('#d mpileaks @2.3' in content) -- cgit v1.2.3-60-g2f50