From 265c479984b94051c982a6be1bd850f8bae02858 Mon Sep 17 00:00:00 2001 From: Gregory Date: Wed, 5 Apr 2023 18:24:21 -0700 Subject: [PATCH] test/cmd/env.py: fix check_viewdir_removal --- lib/spack/spack/test/cmd/env.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/spack/spack/test/cmd/env.py b/lib/spack/spack/test/cmd/env.py index 9c20c3b0048..9afe18dd0e8 100644 --- a/lib/spack/spack/test/cmd/env.py +++ b/lib/spack/spack/test/cmd/env.py @@ -74,9 +74,11 @@ def check_mpileaks_and_deps_in_view(viewdir): def check_viewdir_removal(viewdir): """Check that the uninstall/removal worked.""" - assert not os.path.exists(str(viewdir.join(".spack"))) or os.listdir( - str(viewdir.join(".spack")) - ) == ["projections.yaml"] + view_spack_dir = str(viewdir.join(".spack")) + if not os.path.exists(view_spack_dir): + return + + assert all(f in ["projections.yaml", "metadata.yaml"] for f in os.listdir(view_spack_dir)) def test_add():