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
99
1010class 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 )
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