Skip to content
Snippets Groups Projects
Unverified Commit b3f5084b authored by Todd Gamblin's avatar Todd Gamblin Committed by GitHub
Browse files

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.
parent 95a48b27
Branches
Tags
No related merge requests found
...@@ -218,21 +218,24 @@ def test_remove_command(): ...@@ -218,21 +218,24 @@ def test_remove_command():
assert 'mpileaks@' not in find('--show-concretized') assert 'mpileaks@' not in find('--show-concretized')
def test_environment_status(capfd, tmpdir): def test_environment_status(capsys, tmpdir):
with capfd.disabled():
with tmpdir.as_cwd(): with tmpdir.as_cwd():
with capsys.disabled():
assert 'No active environment' in env('status') 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') 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') assert os.path.join(os.getcwd(), 'local_dir') in env('status')
e = ev.Environment('myproject') e = ev.Environment('myproject')
e.write() e.write()
with tmpdir.join('myproject').as_cwd(): with tmpdir.join('myproject').as_cwd():
with e: with e:
with capsys.disabled():
assert 'in current directory' in env('status') assert 'in current directory' in env('status')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment