Skip to content

Commit 1532df5

Browse files
jeegerTranquility2alexanderankin
authored
feat: set multiple variables via keyword args (#804)
Just a tiny addition to make large configurations easier to do in code. --------- Co-authored-by: Roy Moore <[email protected]> Co-authored-by: David Ankin <[email protected]>
1 parent d749fc6 commit 1532df5

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,4 +167,5 @@
167167

168168
nitpick_ignore = [
169169
("py:class", "typing_extensions.Self"),
170+
("py:class", "docker.models.containers.ExecResult"),
170171
]

core/testcontainers/core/container.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ def with_env(self, key: str, value: str) -> Self:
101101
self.env[key] = value
102102
return self
103103

104+
def with_envs(self, **variables: str) -> Self:
105+
self.env.update(variables)
106+
return self
107+
104108
def with_env_file(self, env_file: Union[str, PathLike[str]]) -> Self:
105109
env_values = dotenv_values(env_file)
106110
for key, value in env_values.items():

0 commit comments

Comments
 (0)