Skip to content

Commit

Permalink
fix at least some tests on windows, see testcontainers#415
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderankin committed Jan 23, 2024
1 parent ea0ee54 commit f77489b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/testcontainers/core/container.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
from platform import system
from typing import Iterable, Optional, Tuple

from docker.models.containers import Container
Expand Down Expand Up @@ -103,6 +104,9 @@ def get_container_host_ip(self) -> str:
if gateway_ip == host:
return self.get_docker_client().bridge_ip(self._container.id)
return gateway_ip
# see https://github.com/testcontainers/testcontainers-python/issues/415
if host == "localnpipe" and "Windows" == system():
return "localhost"
return host

@wait_container_is_ready()
Expand Down

0 comments on commit f77489b

Please sign in to comment.