Skip to content

Commit

Permalink
[tests] Fix temporary environment variable setting.
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisCummins committed Feb 21, 2022
1 parent 1e76147 commit 9076b61
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/llvm/llvm_benchmark_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,14 @@ def test_get_system_library_flags_nonzero_exit_status(caplog):

def test_get_system_library_flags_output_parse_failure(caplog):
"""Test that setting the $CXX to an invalid binary raises an error."""
old_cxx = os.environ.get("CXX")
old_cxx = os.environ.get("CXX", "")
try:
os.environ["CXX"] = "echo"
flags, error = llvm_benchmark._get_cached_system_library_flags("echo")
assert flags == []
assert "Failed to parse '#include <...>' search paths from echo" in error
finally:
if old_cxx:
os.environ["CXX"] = old_cxx
os.environ["CXX"] = old_cxx


def test_get_system_library_flags():
Expand Down

0 comments on commit 9076b61

Please sign in to comment.