From e8394324720aa6bb041e3dddba46faa14626bd85 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Sun, 29 Dec 2019 02:16:14 -0800 Subject: [PATCH] tests: make env tests that use configs non-destructive Environment tests pushed config scopes but didn't properly remove them. - [x] use `with env:` context manager instead of `env.prepare_config_scopes()` --- lib/spack/spack/test/cmd/env.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/spack/spack/test/cmd/env.py b/lib/spack/spack/test/cmd/env.py index 654611565e..fa7f9a640e 100644 --- a/lib/spack/spack/test/cmd/env.py +++ b/lib/spack/spack/test/cmd/env.py @@ -406,8 +406,8 @@ def test_env_with_config(): _env_create('test', StringIO(test_config)) e = ev.read('test') - ev.prepare_config_scope(e) - e.concretize() + with e: + e.concretize() assert any(x.satisfies('mpileaks@2.2') for x in e._get_environment_specs()) @@ -431,8 +431,8 @@ def test_env_with_included_config_file(): version: [2.2] """) - ev.prepare_config_scope(e) - e.concretize() + with e: + e.concretize() assert any(x.satisfies('mpileaks@2.2') for x in e._get_environment_specs()) @@ -460,8 +460,8 @@ def test_env_with_included_config_scope(): version: [2.2] """) - ev.prepare_config_scope(e) - e.concretize() + with e: + e.concretize() assert any(x.satisfies('mpileaks@2.2') for x in e._get_environment_specs()) @@ -490,8 +490,8 @@ def test_env_config_precedence(): version: [0.8.11] """) - ev.prepare_config_scope(e) - e.concretize() + with e: + e.concretize() # ensure included scope took effect assert any( @@ -530,8 +530,8 @@ def test_included_config_precedence(): version: [0.8.12] """) - ev.prepare_config_scope(e) - e.concretize() + with e: + e.concretize() assert any( x.satisfies('mpileaks@2.2') for x in e._get_environment_specs())