Skip to content

Commit 993696a

Browse files
committed
Fix issues from recent merges
1 parent 781dec3 commit 993696a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

core/testcontainers/core/config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from os import environ
55
from os.path import exists
66
from pathlib import Path
7-
from typing import Optional, Union
7+
from typing import Optional, Union, cast
88

99
import docker
1010

@@ -21,7 +21,7 @@ def use_mapped_port(self) -> bool:
2121
2222
This is true for everything but bridge mode.
2323
"""
24-
if self == self.bridge_ip:
24+
if cast(str, self) == self.bridge_ip:
2525
return False
2626
return True
2727

@@ -63,7 +63,7 @@ def get_user_overwritten_connection_mode() -> Optional[ConnectionMode]:
6363
"""
6464
Return the user overwritten connection mode.
6565
"""
66-
connection_mode: str | None = environ.get("TESTCONTAINERS_CONNECTION_MODE")
66+
connection_mode: Union[str, None] = environ.get("TESTCONTAINERS_CONNECTION_MODE")
6767
if connection_mode:
6868
try:
6969
return ConnectionMode(connection_mode)

core/testcontainers/core/docker_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ def get_connection_mode(self) -> ConnectionMode:
222222
# default for DinD
223223
return ConnectionMode.gateway_ip
224224

225-
def host(self) -> Optional[str]:
225+
def host(self) -> str:
226226
"""
227227
Get the hostname or ip address of the docker host.
228228
"""

0 commit comments

Comments
 (0)