summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Kuhn <suraia@ikkoku.de>2016-07-21 17:07:15 +0200
committerMichael Kuhn <suraia@ikkoku.de>2016-08-04 13:07:33 +0200
commit1578a959823bbb8a5ab229a1ba0d11d3d96cc180 (patch)
treeda5167a817891144e0dd8bcdf7b82ce5509b7fd3
parent7affaca32135c920da5e8ec7473017cbd36c8e30 (diff)
downloadspack-1578a959823bbb8a5ab229a1ba0d11d3d96cc180.tar.gz
spack-1578a959823bbb8a5ab229a1ba0d11d3d96cc180.tar.bz2
spack-1578a959823bbb8a5ab229a1ba0d11d3d96cc180.tar.xz
spack-1578a959823bbb8a5ab229a1ba0d11d3d96cc180.zip
Fix tests.
-rw-r--r--lib/spack/spack/graph.py2
-rw-r--r--lib/spack/spack/test/spec_dag.py21
2 files changed, 11 insertions, 12 deletions
diff --git a/lib/spack/spack/graph.py b/lib/spack/spack/graph.py
index 6a80c7d472..5ecd40bd3d 100644
--- a/lib/spack/spack/graph.py
+++ b/lib/spack/spack/graph.py
@@ -94,7 +94,7 @@ def topological_sort(spec, **kwargs):
nodes = spec.index()
topo_order = []
- par = {name: parents(nodes[name]) for name in nodes.keys()}
+ par = dict((name, parents(nodes[name])) for name in nodes.keys())
remaining = [name for name in nodes.keys() if not parents(nodes[name])]
heapify(remaining)
diff --git a/lib/spack/spack/test/spec_dag.py b/lib/spack/spack/test/spec_dag.py
index 972e79aa20..fd57a4ea4b 100644
--- a/lib/spack/spack/test/spec_dag.py
+++ b/lib/spack/spack/test/spec_dag.py
@@ -476,20 +476,20 @@ class SpecDagTest(MockPackagesTest):
dag = Spec('dtuse')
dag.normalize()
- names = ['dtuse', 'dttop', 'dtlink1', 'dtlink3', 'dtlink4',
- 'dtrun1', 'dtlink5', 'dtrun3']
+ names = ['dtuse', 'dttop', 'dtbuild1', 'dtbuild2', 'dtlink2',
+ 'dtlink1', 'dtlink3', 'dtlink4']
- traversal = dag.traverse()
+ traversal = dag.traverse(deptype=('build', 'link'))
self.assertEqual([x.name for x in traversal], names)
def test_deptype_traversal_with_builddeps(self):
dag = Spec('dttop')
dag.normalize()
- names = ['dttop', 'dtbuild1', 'dtlink2', 'dtrun2', 'dtlink1',
- 'dtlink3', 'dtlink4', 'dtrun1', 'dtlink5', 'dtrun3']
+ names = ['dttop', 'dtbuild1', 'dtbuild2', 'dtlink2',
+ 'dtlink1', 'dtlink3', 'dtlink4']
- traversal = dag.traverse()
+ traversal = dag.traverse(deptype=('build', 'link'))
self.assertEqual([x.name for x in traversal], names)
def test_deptype_traversal_full(self):
@@ -500,15 +500,14 @@ class SpecDagTest(MockPackagesTest):
'dtlink1', 'dtlink3', 'dtlink4', 'dtrun1', 'dtlink5',
'dtrun3', 'dtbuild3']
- traversal = dag.traverse(deptype_query=spack.alldeps)
+ traversal = dag.traverse(deptype=spack.alldeps)
self.assertEqual([x.name for x in traversal], names)
- def test_deptype_traversal_pythonpath(self):
+ def test_deptype_traversal_run(self):
dag = Spec('dttop')
dag.normalize()
- names = ['dttop', 'dtbuild1', 'dtrun2', 'dtlink1', 'dtrun1',
- 'dtrun3']
+ names = ['dttop', 'dtrun1', 'dtrun3']
- traversal = dag.traverse(deptype=spack.nolink, deptype_query='run')
+ traversal = dag.traverse(deptype='run')
self.assertEqual([x.name for x in traversal], names)