summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/test/cmd/compiler_command.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/spack/spack/test/cmd/compiler_command.py b/lib/spack/spack/test/cmd/compiler_command.py
index 042cb99484..e40e49544d 100644
--- a/lib/spack/spack/test/cmd/compiler_command.py
+++ b/lib/spack/spack/test/cmd/compiler_command.py
@@ -6,7 +6,6 @@
import pytest
import os
-import os.path
import spack.main
@@ -26,8 +25,16 @@ def no_compilers_yaml(mutable_config, monkeypatch):
@pytest.mark.regression('11678')
-@pytest.mark.requires_executables('/usr/bin/gcc')
-def test_compiler_find_without_paths(no_compilers_yaml):
+def test_compiler_find_without_paths(no_compilers_yaml, working_env, tmpdir):
+ with tmpdir.as_cwd():
+ with open('gcc', 'w') as f:
+ f.write("""\
+#!/bin/bash
+echo "0.0.0"
+""")
+ os.chmod('gcc', 0o700)
+
+ os.environ['PATH'] = str(tmpdir)
output = compiler('find', '--scope=site')
assert 'gcc' in output