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