@then(u'the docker container has at most {num} exec instances')
def check_container_exec_instances(context, num):
    """Modern docker versions remove ExecIDs after they finished, but older
    docker versions leave ExecIDs behind. This test is for assering that
    the ExecIDs are cleaned up one way or another"""
    container_info = context.docker_client.inspect_container(context.running_container_id)
    if container_info['ExecIDs'] is None:
        execs = []
    else:
        execs = container_info['ExecIDs']
    print 'Container info:\n%s' % container_info
    assert len(execs) <= int(num)
dataset/ETHPy150Open Yelp/paasta/general_itests/steps/paasta_execute_docker_command.py/check_container_exec_instances/original