def validate_script_error_exit_code(exception, exit_code=1):
    """
    Assert running script raises specified exit code
    """
    assert exception.type == SystemExit
    assert exception.value.code == exit_code
    return exception