Skip to content

Commit 998e426

Browse files
committed
fix(core): fix issues with doctests
1 parent fe941b1 commit 998e426

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

core/testcontainers/compose/compose.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ def _ignore_properties(cls: type[_IPT], dict_: Any) -> _IPT:
3636
@dataclass
3737
class PublishedPortModel:
3838
"""
39-
Class that represents the response we get from compose when inquiring status
40-
via `DockerCompose.get_running_containers()`.
39+
Class that represents the response we get from compose when inquiring status via `DockerCompose.get_running_containers()`.
4140
"""
4241

4342
URL: Optional[str] = None
@@ -247,7 +246,9 @@ def docker_compose_command(self) -> list[str]:
247246

248247
@cached_property
249248
def compose_command_property(self) -> list[str]:
250-
docker_compose_cmd = [self.docker_command_path, "compose"] if self.docker_command_path else ["docker", "compose"]
249+
docker_compose_cmd = (
250+
[self.docker_command_path, "compose"] if self.docker_command_path else ["docker", "compose"]
251+
)
251252
if self.compose_file_name:
252253
for file in self.compose_file_name:
253254
docker_compose_cmd += ["-f", file]
@@ -261,6 +262,7 @@ def compose_command_property(self) -> list[str]:
261262
def waiting_for(self, strategies: dict[str, WaitStrategy]) -> "DockerCompose":
262263
"""
263264
Set wait strategies for specific services.
265+
264266
Args:
265267
strategies: Dictionary mapping service names to wait strategies
266268
"""

core/testcontainers/core/container.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,11 @@ class DockerContainer:
3939
4040
Args:
4141
image: The name of the image to start.
42-
docker_client_kw: Dictionary with arguments that will be passed to the
43-
docker.DockerClient init.
42+
docker_client_kw: Dictionary with arguments that will be passed to the docker.DockerClient init.
4443
command: Optional execution command for the container.
4544
name: Optional name for the container.
46-
ports: Ports to be exposed by the container. The port number will be
47-
automatically assigned on the host, use
48-
:code:`get_exposed_port(PORT)` method to get the port number on the host.
49-
volumes: Volumes to mount into the container. Each entry should be a tuple with
50-
three values: host path, container path and. mode (default 'ro').
45+
ports: Ports to be exposed by the container. The port number will be automatically assigned on the host, use :code:`get_exposed_port(PORT)` method to get the port number on the host.
46+
volumes: Volumes to mount into the container. Each entry should be a tuple with three values: host path, container path and mode (default 'ro').
5147
network: Optional network to connect the container to.
5248
network_aliases: Optional list of aliases for the container in the network.
5349

0 commit comments

Comments
 (0)