diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/test/cmd/pkg.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/spack/spack/test/cmd/pkg.py b/lib/spack/spack/test/cmd/pkg.py index 2f1a1a6f3a..3f0b89309b 100644 --- a/lib/spack/spack/test/cmd/pkg.py +++ b/lib/spack/spack/test/cmd/pkg.py @@ -297,19 +297,19 @@ def test_pkg_hash(mock_packages): @pytest.mark.skipif(not spack.cmd.pkg.get_grep(), reason="grep is not installed") -def test_pkg_grep(mock_packages, capsys): +def test_pkg_grep(mock_packages, capfd): # only splice-* mock packages have the string "splice" in them - with capsys.disabled(): - output = pkg("grep", "-l", "splice", output=str) - + pkg("grep", "-l", "splice", output=str) + output, _ = capfd.readouterr() assert output.strip() == "\n".join( spack.repo.path.get_pkg_class(name).module.__file__ for name in ["splice-a", "splice-h", "splice-t", "splice-vh", "splice-z"] ) # ensure that this string isn't fouhnd - output = pkg("grep", "abcdefghijklmnopqrstuvwxyz", output=str, fail_on_error=False) + pkg("grep", "abcdefghijklmnopqrstuvwxyz", output=str, fail_on_error=False) assert pkg.returncode == 1 + output, _ = capfd.readouterr() assert output.strip() == "" # ensure that we return > 1 for an error |