Skip to content

Commit 659a3d9

Browse files
add compose documentation and at least list the methods in DockerContainer
1 parent 4d00630 commit 659a3d9

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

core/README.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@ Testcontainers Core
33

44
:code:`testcontainers-core` is the core functionality for spinning up Docker containers in test environments.
55

6-
.. autoclass:: testcontainers.core.container.DockerContainer
6+
.. automodule:: testcontainers.core.container
7+
:members:
8+
:undoc-members:
9+
10+
.. automodule:: testcontainers.core.network
11+
:members:
712

813
.. autoclass:: testcontainers.core.image.DockerImage
914

@@ -18,7 +23,8 @@ Compose
1823

1924
It is also possible to use Docker Compose functionality:
2025

21-
.. autoclass:: testcontainers.compose.compose.DockerCompose
26+
.. automodule:: testcontainers.compose.compose
27+
:members:
2228

2329
.. raw:: html
2430

core/testcontainers/compose/compose.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def docker_compose_command(self) -> list[str]:
189189
Returns command parts used for the docker compose commands
190190
191191
Returns:
192-
cmd: Docker compose command parts.
192+
str: Docker compose command parts.
193193
"""
194194
return self.compose_command_property
195195

@@ -255,8 +255,8 @@ def get_logs(self, *services: str) -> tuple[str, str]:
255255
:param services: which services to get the logs for (or omit, for all)
256256
257257
Returns:
258-
stdout: Standard output stream.
259-
stderr: Standard error stream.
258+
str: stdout: Standard output stream.
259+
str: stderr: Standard error stream.
260260
"""
261261
logs_cmd = [*self.compose_command_property, "logs", *services]
262262

@@ -362,9 +362,9 @@ def exec_in_container(
362362
:param command: the command to run in the container
363363
364364
Returns:
365-
stdout: Standard output stream.
366-
stderr: Standard error stream.
367-
exit_code: The command's exit code.
365+
str: stdout: Standard output stream.
366+
str: stderr: Standard error stream.
367+
int: exit_code: The command's exit code.
368368
"""
369369
if not service_name:
370370
service_name = self.get_container().Service

core/testcontainers/core/container.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ def get_wrapped_container(self) -> "Container":
172172
return self._container
173173

174174
def get_docker_client(self) -> DockerClient:
175+
"""
176+
:meta private:
177+
"""
175178
return self._docker
176179

177180
def get_logs(self) -> tuple[bytes, bytes]:
@@ -190,6 +193,9 @@ def _configure(self) -> None:
190193

191194

192195
class Reaper:
196+
"""
197+
:meta private:
198+
"""
193199
_instance: "Optional[Reaper]" = None
194200
_container: Optional[DockerContainer] = None
195201
_socket: Optional[socket] = None

0 commit comments

Comments
 (0)