Sceptre / sceptre

Build better AWS infrastructure

Home Page:https://docs.sceptre-project.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug in hooks test on MacOS

alex-harvey-z3q opened this issue · comments

Subject of the issue

A unit test has been added that makes assumptions about the version of /bin/sh and does not account for platform-specific differences in the behaviour.

Your environment

  • version of sceptre (sceptre --version) LATEST
  • version of python (python --version) all
  • which OS/distro MacOS

Steps to reproduce

On the MacOS platform, run the tests:

pytest -ssv tests/test_hooks/test_cmd.py 

Expected behaviour

Should pass

Actual behaviour

    def test_hook_writes_to_stderr(stack, capfd):
        with pytest.raises(Exception):
            Cmd("missing_command", stack).run()
        cap = capfd.readouterr()
        assert cap.out.strip() == ""
>       assert cap.err.strip() == "/bin/sh: 1: missing_command: not found"
E       AssertionError: assert '/bin/sh: mis...and not found' == '/bin/sh: 1: ...nd: not found'
E         - /bin/sh: 1: missing_command: not found
E         ?         ---
E         + /bin/sh: missing_command: command not found
E         ?                           ++++++++

More info:

% uname -s
Darwin
% /bin/sh -c missing_command
/bin/sh: missing_command: command not found
# uname -s 
Linux
# /bin/sh -c missing_command 
/bin/sh: 1: missing_command: not found

Oops, this was already fixed in 0d05f7f