INNER CODE UNIT · Python

_build

awslabs/awsome-distributed-ai · conftest.py:19

    def _build(name, dockerfile, test_tag=".test"):
        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

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…