File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change 4
4
5
5
from testcontainers .core .docker_client import DockerClient
6
6
from testcontainers .core .exceptions import ContainerStartException
7
- from testcontainers .core .utils import is_windows , inside_container
7
+ from testcontainers .core .utils import inside_container
8
8
9
9
10
10
class DockerContainer (object ):
@@ -81,10 +81,7 @@ def get_container_host_ip(self) -> str:
81
81
# container's IP address from the dockder "bridge" network
82
82
if inside_container ():
83
83
return self .get_docker_client ().bridge_ip (self ._container .id )
84
- elif is_windows ():
85
- return "localhost"
86
- else :
87
- return "0.0.0.0"
84
+ return "localhost"
88
85
89
86
def get_exposed_port (self , port ) -> str :
90
87
if inside_container ():
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ def test_docker_env_variables():
30
30
db .with_bind_ports (3306 , 32785 )
31
31
with db :
32
32
url = db .get_connection_url ()
33
- assert url == 'mysql+pymysql://demo:test@0.0.0.0 :32785/custom_db'
33
+ assert url == 'mysql+pymysql://demo:test@localhost :32785/custom_db'
34
34
35
35
36
36
def test_docker_kargs ():
You can’t perform that action at this time.
0 commit comments