From e2eb39352b89cb20fddbf499594b5e6b95c91481 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Thu, 1 Jan 2026 18:10:20 +0200 Subject: [PATCH] feat(core): Pass-through extra arguments to the underlying container --- core/testcontainers/core/container.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/testcontainers/core/container.py b/core/testcontainers/core/container.py index 4bb4eec4..1fde43fb 100644 --- a/core/testcontainers/core/container.py +++ b/core/testcontainers/core/container.py @@ -295,10 +295,10 @@ def status(self) -> str: return "not_started" return cast("str", self._container.status) - def exec(self, command: Union[str, list[str]]) -> ExecResult: + def exec(self, command: Union[str, list[str]], *args: Any, **kwargs: Any) -> ExecResult: if not self._container: raise ContainerStartException("Container should be started before executing a command") - return self._container.exec_run(command) + return self._container.exec_run(command, *args, **kwargs) def _configure(self) -> None: # placeholder if subclasses want to define this and use the default start method