Skip to content

Commit 386521f

Browse files
#415 fix (#427)
1 parent b535ea2 commit 386521f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

core/testcontainers/core/container.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
from platform import system
23
from typing import Optional, Tuple
34

45
from docker.models.containers import Container
@@ -92,6 +93,9 @@ def get_container_host_ip(self) -> str:
9293
host = self.get_docker_client().host()
9394
if not host:
9495
return "localhost"
96+
# see https://github.com/testcontainers/testcontainers-python/issues/415
97+
if host == "localnpipe" and "Windows" == system():
98+
return "localhost"
9599

96100
# check testcontainers itself runs inside docker container
97101
if inside_container() and not os.getenv("DOCKER_HOST"):

0 commit comments

Comments
 (0)