summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2019-10-22 23:59:28 -0700
committerGitHub <noreply@github.com>2019-10-22 23:59:28 -0700
commitb3f5084b96f1458e5ec041f197e0b0dabbc0ecff (patch)
treefa874a33dd07b9b16abae6cdc1d6f899d4010420
parent95a48b27ec09b691d4107d48854126c045b03188 (diff)
downloadspack-b3f5084b96f1458e5ec041f197e0b0dabbc0ecff.tar.gz
spack-b3f5084b96f1458e5ec041f197e0b0dabbc0ecff.tar.bz2
spack-b3f5084b96f1458e5ec041f197e0b0dabbc0ecff.tar.xz
spack-b3f5084b96f1458e5ec041f197e0b0dabbc0ecff.zip
tests: avoid extra output in `env status` test (#13344)
`test_envoronment_status()` was printing extra output during tests. - [x] disable output only for `env('status')` calls instead of disabling it for the whole test.
-rw-r--r--lib/spack/spack/test/cmd/env.py21
1 files changed, 12 insertions, 9 deletions
diff --git a/lib/spack/spack/test/cmd/env.py b/lib/spack/spack/test/cmd/env.py
index f2912f3ec0..c3fb911336 100644
--- a/lib/spack/spack/test/cmd/env.py
+++ b/lib/spack/spack/test/cmd/env.py
@@ -218,21 +218,24 @@ def test_remove_command():
assert 'mpileaks@' not in find('--show-concretized')
-def test_environment_status(capfd, tmpdir):
- with capfd.disabled():
- with tmpdir.as_cwd():
+def test_environment_status(capsys, tmpdir):
+ with tmpdir.as_cwd():
+ with capsys.disabled():
assert 'No active environment' in env('status')
- with ev.create('test'):
+ with ev.create('test'):
+ with capsys.disabled():
assert 'In environment test' in env('status')
- with ev.Environment('local_dir'):
+ with ev.Environment('local_dir'):
+ with capsys.disabled():
assert os.path.join(os.getcwd(), 'local_dir') in env('status')
- e = ev.Environment('myproject')
- e.write()
- with tmpdir.join('myproject').as_cwd():
- with e:
+ e = ev.Environment('myproject')
+ e.write()
+ with tmpdir.join('myproject').as_cwd():
+ with e:
+ with capsys.disabled():
assert 'in current directory' in env('status')