Skip to content

Commit b8e76bc

Browse files
committed
Fix issues from recent merges
1 parent cf6ca6b commit b8e76bc

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

1010
class ConnectionMode(Enum):
@@ -19,7 +19,7 @@ def use_mapped_port(self) -> bool:
1919
2020
This is true for everything but bridge mode.
2121
"""
22-
if self == self.bridge_ip:
22+
if cast(str, self) == self.bridge_ip:
2323
return False
2424
return True
2525

@@ -43,7 +43,7 @@ def get_user_overwritten_connection_mode() -> Optional[ConnectionMode]:
4343
"""
4444
Return the user overwritten connection mode.
4545
"""
46-
connection_mode: str | None = environ.get("TESTCONTAINERS_CONNECTION_MODE")
46+
connection_mode: Union[str, None] = environ.get("TESTCONTAINERS_CONNECTION_MODE")
4747
if connection_mode:
4848
try:
4949
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)