Skip to content

Commit

Permalink
Fixed test.
Browse files Browse the repository at this point in the history
  • Loading branch information
hiker committed Aug 12, 2024
1 parent c1eb158 commit 02fbb7b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/unit_tests/tools/test_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,16 +566,17 @@ def test_ifort_get_version_with_icc_string():
"0.5.1.",
"0.5..1"])
def test_ifort_get_version_invalid_version(version):
'''Tests the ifort class with an icc version output.'''
'''Tests the icc class with an icc version string that contains an invalid
version number.'''
full_output = dedent(f"""
icc (ICC) {version} 20230609
Copyright (C) 1985-2023 Intel Corporation. All rights reserved.
""")
ifort = Ifort()
with mock.patch.object(ifort, "run", mock.Mock(return_value=full_output)):
icc = Icc()
with mock.patch.object(icc, "run", mock.Mock(return_value=full_output)):
with pytest.raises(RuntimeError) as err:
ifort.get_version()
icc.get_version()
assert "Unexpected version output format for compiler" in str(err.value)


Expand Down

0 comments on commit 02fbb7b

Please sign in to comment.