INNER CODE UNIT · Python
img_name
awslabs/awsome-distributed-ai · conftest.py:20
img_name=name + test_tag
subprocess.check_call(['docker', 'build', '-t', img_name, '-f', dockerfile, '.'])
img_list.append(img_name)
return img_name
yield _build
if request.config.option.keep_artifacts is None:
for img in img_list:
subprocess.check_call(['docker', 'image', 'rm', img])
@pytest.fixture
def docker_run(change_test_dir):
def _run(name, cmd, args=["--rm"]):
subprocess.check_call(['docker', 'run'] + args + [name] + cmd)
yield _run