Skip to content

Commit

Permalink
Improved tests by checking for the error message
Browse files Browse the repository at this point in the history
Signed-off-by: Jean-Christophe Morin <[email protected]>
  • Loading branch information
JeanChristopheMorinPerso committed Jul 21, 2024
1 parent fa0cd1f commit 8a990a5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/rez/tests/test_utils_elf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ def tearDownClass(cls):
@program_dependent("readelf")
def test_get_rpaths_raises_runtime_exception(self):
"""Tests that no TypeError from elf functions are raised."""
with self.assertRaises(RuntimeError):
with self.assertRaises(RuntimeError) as exc:
get_rpaths("/path/to/elfpath")
self.assertIn("'/path/to/elfpath': No such file", str(exc.exception))

with self.assertRaises(RuntimeError):
with self.assertRaises(RuntimeError) as exc:
patch_rpaths("/path/to/elfpath", ["$ORIGIN", "$ORIGINTEST"])
self.assertIn("'/path/to/elfpath': No such file", str(exc.exception))

0 comments on commit 8a990a5

Please sign in to comment.