test_which: do not mutate os.environ
This commit is contained in:
parent
2cbe84b1ee
commit
5b386cf9b1
@ -89,8 +89,8 @@ def test_which_with_slash_ignores_path(tmpdir, working_env):
|
|||||||
assert exe.path == path
|
assert exe.path == path
|
||||||
|
|
||||||
|
|
||||||
def test_which(tmpdir):
|
def test_which(tmpdir, monkeypatch):
|
||||||
os.environ["PATH"] = str(tmpdir)
|
monkeypatch.setenv("PATH", str(tmpdir))
|
||||||
assert ex.which("spack-test-exe") is None
|
assert ex.which("spack-test-exe") is None
|
||||||
|
|
||||||
with pytest.raises(ex.CommandNotFoundError):
|
with pytest.raises(ex.CommandNotFoundError):
|
||||||
|
Loading…
Reference in New Issue
Block a user