Skip to content

Commit 9eabb79

Browse files
DandiggasDandiggas
andauthored
fix: added types to exec & tc_properties_get_tc_host (#561)
#557 - trying to solve this issue by adding types. --------- Co-authored-by: Dandiggas <[email protected]>
1 parent 6f9376c commit 9eabb79

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

core/testcontainers/core/config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from os import environ
33
from os.path import exists
44
from pathlib import Path
5+
from typing import Union
56

67
MAX_TRIES = int(environ.get("TC_MAX_TRIES", 120))
78
SLEEP_TIME = int(environ.get("TC_POOLING_INTERVAL", 1))
@@ -47,7 +48,7 @@ class TestcontainersConfiguration:
4748
ryuk_reconnection_timeout: str = RYUK_RECONNECTION_TIMEOUT
4849
tc_properties: dict[str, str] = field(default_factory=read_tc_properties)
4950

50-
def tc_properties_get_tc_host(self):
51+
def tc_properties_get_tc_host(self) -> Union[str, None]:
5152
return self.tc_properties.get("tc.host")
5253

5354
@property

core/testcontainers/core/container.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def get_logs(self) -> tuple[bytes, bytes]:
172172
raise ContainerStartException("Container should be started before getting logs")
173173
return self._container.logs(stderr=False), self._container.logs(stdout=False)
174174

175-
def exec(self, command) -> tuple[int, str]:
175+
def exec(self, command) -> tuple[int, bytes]:
176176
if not self._container:
177177
raise ContainerStartException("Container should be started before executing a command")
178178
return self._container.exec_run(command)

0 commit comments

Comments
 (0)