Skip to content

Commit

Permalink
Stop adding useless labels to containers
Browse files Browse the repository at this point in the history
  • Loading branch information
dcermak committed Aug 23, 2024
1 parent 3216b4e commit c3679ae
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions pytest_container/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,27 +91,12 @@ def fixture_funct(
f"A singleton container ({container}) cannot be used in a session level fixture"
)

add_labels = [
"--label",
f"pytest_container.request={request}",
"--label",
f"pytest_container.node.name={request.node.name}",
"--label",
f"pytest_container.scope={request.scope}",
]
try:
add_labels.extend(
["--label", f"pytest_container.path={request.path}"]
)
except AttributeError:
pass

with ContainerLauncher(
container=container,
container_runtime=container_runtime,
rootdir=pytestconfig.rootpath,
extra_build_args=get_extra_build_args(pytestconfig),
extra_run_args=get_extra_run_args(pytestconfig) + add_labels,
extra_run_args=get_extra_run_args(pytestconfig),
) as launcher:
# we want to ensure that the container's logs are saved at "all
# cost", especially when the container fails to launch for some
Expand Down

0 comments on commit c3679ae

Please sign in to comment.