Skip to content

Commit

Permalink
encapsulate get_tc_host for #494
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderankin committed Apr 8, 2024
1 parent a79eeff commit 64c2534
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions core/testcontainers/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ class TestcontainersConfiguration:
ryuk_reconnection_timeout: str = RYUK_RECONNECTION_TIMEOUT
tc_properties: dict[str, str] = field(default_factory=read_tc_properties)

def tc_properties_get_tc_host(self):
return self.tc_properties.get("tc.host")

@property
def timeout(self):
return self.max_tries * self.sleep_time
Expand Down
2 changes: 1 addition & 1 deletion core/testcontainers/core/docker_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,4 @@ def host(self) -> str:


def get_docker_host() -> Optional[str]:
return c.tc_properties.get("tc.host") or os.getenv("DOCKER_HOST")
return c.tc_properties_get_tc_host() or os.getenv("DOCKER_HOST")

0 comments on commit 64c2534

Please sign in to comment.