diff --git a/tests/test_container_template.py b/tests/test_container_template.py index 3f37b31..1e50208 100644 --- a/tests/test_container_template.py +++ b/tests/test_container_template.py @@ -9,16 +9,10 @@ """ import os -import socket import subprocess import tempfile -# port used by tests -sock = socket.socket() -sock.bind(('', 0)) -port = sock.getsockname()[1] - # Check that (1) singularity or apptainer executables exist, # and (2) if not, check for docker. # If neither are found, tests will fall back to plain python. @@ -44,14 +38,14 @@ try: runtime = 'docker' out = subprocess.run(runtime, check=False) - PREFIX = (f'{runtime} run -p {port}:{port} ' + + PREFIX = (f'{runtime} run ' + 'ghcr.io/precimed/container_template python') PREFIX_MOUNT = ( - f'{runtime} run -p {port}:{port} ' + + f'{runtime} run ' + f'--mount type=bind,source={cwd},target={cwd} ' + 'ghcr.io/precimed/container_template python') PREFIX_CUSTOM_MOUNT = ( - f'{runtime} run -p {port}:{port} ' + + f'{runtime} run ' + f'--mount type=bind,source={cwd},target={cwd} ' + '{custom_mount} ' + 'ghcr.io/precimed/container_template python')