Skip to content

Commit

Permalink
fix: Fix the return type of DockerContainer.get_logs (#487)
Browse files Browse the repository at this point in the history
  • Loading branch information
kshramt committed Mar 24, 2024
1 parent 1d10c1c commit cd72f68
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/testcontainers/core/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def get_wrapped_container(self) -> "Container":
def get_docker_client(self) -> DockerClient:
return self._docker

def get_logs(self) -> tuple[str, str]:
def get_logs(self) -> tuple[bytes, bytes]:
if not self._container:
raise ContainerStartException("Container should be started before getting logs")
return self._container.logs(stderr=False), self._container.logs(stdout=False)
Expand Down
2 changes: 2 additions & 0 deletions core/tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ def test_can_get_logs():
with DockerContainer("hello-world") as container:
wait_for_logs(container, "Hello from Docker!")
stdout, stderr = container.get_logs()
assert isinstance(stdout, bytes)
assert isinstance(stderr, bytes)
assert stdout, "There should be something on stdout"

0 comments on commit cd72f68

Please sign in to comment.