Skip to content

Commit 9b7d8ba

Browse files
committed
Add failing unit test
Signed-off-by: brycegbrazen <[email protected]>
1 parent a13f7bb commit 9b7d8ba

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/rez/tests/test_shells.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,22 @@ def _make_alias(ex):
591591
out, _ = p.communicate()
592592
self.assertEqual(0, p.returncode)
593593

594+
@per_available_shell()
595+
def test_alias_non_existent_command_return_code(self, shell):
596+
"""Ensure return codes are correct while using aliases."""
597+
config.override("default_shell", shell)
598+
599+
def _make_alias(ex):
600+
ex.alias('my_alias', 'a_non_existent_executable')
601+
602+
r = self._create_context([])
603+
p = r.execute_shell(command='my_alias',
604+
actions_callback=_make_alias,
605+
stdout=subprocess.PIPE)
606+
607+
out, _ = p.communicate()
608+
self.assertNotEqual(0, p.returncode)
609+
594610

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

0 commit comments

Comments
 (0)