Skip to content

Commit

Permalink
Add new unit test
Browse files Browse the repository at this point in the history
Signed-off-by: brycegbrazen <[email protected]>
  • Loading branch information
brycegbrazen committed Jun 21, 2024
1 parent a13f7bb commit 6af4597
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/rez/tests/test_shells.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,22 @@ def _make_alias(ex):
out, _ = p.communicate()
self.assertEqual(0, p.returncode)

@per_available_shell()
def test_alias_return_code(self, shell):
"""Ensure return codes are correct while using aliases."""
config.override("default_shell", shell)

def _make_alias(ex):
ex.alias('python_alias', 'python')

r = self._create_context([])
p = r.execute_shell(command='python_alias -c raise',
actions_callback=_make_alias,
stdout=subprocess.PIPE)

out, _ = p.communicate()
self.assertEqual(1, p.returncode)


if __name__ == '__main__':
unittest.main()

0 comments on commit 6af4597

Please sign in to comment.