Skip to content

Commit 9f49104

Browse files
authored
Minor fixes (#639)
fix tests to be robust to non-breaking api changes. Also, change binary asset check so it is not recursive. This avoids an infinite loop in some environments.
1 parent 41b6310 commit 9f49104

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

manager/manager_cmds/distribution.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -393,11 +393,10 @@ def _write(self, data):
393393

394394

395395
def is_installed(spec):
396-
status = True
397-
for dependency in spec.dependencies(deptype=("link", "run")):
398-
status = is_installed(dependency)
396+
deps = list(spec.dependencies(deptype=("link", "run")))
399397
bad_statuses = [spack.spec.InstallStatus.absent, spack.spec.InstallStatus.missing]
400-
return status and spec.install_status() not in bad_statuses
398+
dep_status = [x.install_status() not in bad_statuses for x in deps]
399+
return all(dep_status) and spec.install_status() not in bad_statuses
401400

402401

403402
def correct_mirror_args(env, args):

tests/test_distribution.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ def test_DistributionPackager_configure_source_mirror_create_mirror_called_corre
715715

716716
def mirror_for_specs(*args, **kwargs):
717717
assert len(args) == 0
718-
assert len(kwargs) == len(valid_params)
718+
assert len(kwargs) <= len(valid_params)
719719
for kwarg in kwargs:
720720
assert kwarg in valid_params
721721

0 commit comments

Comments
 (0)