summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin.mock/packages/multimethod/package.py
diff options
context:
space:
mode:
Diffstat (limited to 'var/spack/repos/builtin.mock/packages/multimethod/package.py')
-rw-r--r--var/spack/repos/builtin.mock/packages/multimethod/package.py15
1 files changed, 4 insertions, 11 deletions
diff --git a/var/spack/repos/builtin.mock/packages/multimethod/package.py b/var/spack/repos/builtin.mock/packages/multimethod/package.py
index ca991632dd..fa3f815135 100644
--- a/var/spack/repos/builtin.mock/packages/multimethod/package.py
+++ b/var/spack/repos/builtin.mock/packages/multimethod/package.py
@@ -22,12 +22,10 @@
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
-import imp
-from llnl.util.filesystem import join_path
-from spack.util.naming import mod_to_class
from spack import *
import spack.architecture
+
class Multimethod(Package):
"""This package is designed for use with Spack's multimethod test.
It has a bunch of test cases for the @when decorator that the
@@ -52,7 +50,6 @@ class Multimethod(Package):
def no_version_2(self):
return 4
-
#
# These functions overlap, so there is ambiguity, but we'll take
# the first one.
@@ -65,7 +62,6 @@ class Multimethod(Package):
def version_overlap(self):
return 2
-
#
# More complicated case with cascading versions.
#
@@ -84,7 +80,6 @@ class Multimethod(Package):
def mpi_version(self):
return 1
-
#
# Use these to test whether the default method is called when no
# match is found. This also tests whether we can switch methods
@@ -101,8 +96,6 @@ class Multimethod(Package):
def has_a_default(self):
return 'intel'
-
-
#
# Make sure we can switch methods on different target
#
@@ -112,15 +105,16 @@ class Multimethod(Package):
targets = targets[:-1]
for target in targets:
- @when('target='+target.name)
+ @when('target=' + target.name)
def different_by_target(self):
- if isinstance(self.spec.architecture.target,basestring):
+ if isinstance(self.spec.architecture.target, basestring):
return self.spec.architecture.target
else:
return self.spec.architecture.target.name
#
# Make sure we can switch methods on different dependencies
#
+
@when('^mpich')
def different_by_dep(self):
return 'mpich'
@@ -129,7 +123,6 @@ class Multimethod(Package):
def different_by_dep(self):
return 'zmpi'
-
#
# Make sure we can switch on virtual dependencies
#