File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 44from os import environ
55from os .path import exists
66from pathlib import Path
7- from typing import Optional , Union
7+ from typing import Optional , Union , cast
88
99import 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 )
Original file line number Diff line number Diff 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 """
You can’t perform that action at this time.
0 commit comments