def container_name(): name = "{}-{}".format(CONTAINER_NAME, int(time.time() * 1000)) yield name if not CLEAR: return rm_container(name) rm_image(name + ":latest") # FIXME later
def runner(): args = [] def _runner(host: TargetHost, img: DockerImage, container_name: str): args.append((host, img, container_name)) return SimpleDockerRunner() yield _runner for h, i, c in args: rm_container(c, h.get_host()) rm_image(i.get_image_uri, h.get_host())
def runner(pytestconfig): if not has_docker() or 'not docker' in pytestconfig.getoption('markexpr'): pytest.skip('skipping docker tests') args = [] def _runner(host: str, img: DockerImage, container_name: str): args.append((host, img, container_name)) return DockerRunner() yield _runner for h, i, c in args: rm_container(c, h) rm_image(i.get_uri(), h)
def service_name(): service_name = 'ebnt-test-service' yield service_name rm_container(service_name) rm_image(service_name + ":latest")
def img_name(): img_name = "helper-test-image" with use_local_installation(): yield img_name rm_image(img_name + ":latest") # FIXME later