diff --git a/pyproject.toml b/pyproject.toml index bb60d17..66095ad 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ classifiers = [ "Topic :: Software Development :: Quality Assurance", "Topic :: Software Development :: Libraries :: Python Modules", ] -requires-python = ">=3.9, <3.14" +requires-python = ">=3.9.2, <3.14" dependencies = [ "requests>=2.32.4" ] @@ -37,7 +37,7 @@ dependencies = [ [project.optional-dependencies] testing = [ "docker>=7.1.0", - "testcontainers>=3.7.1,<4.0.0", + "testcontainers>=4.13.2", ] [dependency-groups] diff --git a/wiremock/testing/testcontainer.py b/wiremock/testing/testcontainer.py index b9580a1..8761c0f 100644 --- a/wiremock/testing/testcontainer.py +++ b/wiremock/testing/testcontainer.py @@ -12,7 +12,7 @@ import requests from testcontainers.core.container import DockerContainer from testcontainers.core.exceptions import ContainerStartException -from testcontainers.core.waiting_utils import wait_container_is_ready +from testcontainers.core.wait_strategies import HttpWaitStrategy from wiremock.resources.mappings.models import Mapping @@ -187,7 +187,6 @@ def reload_mappings(self) -> requests.Response: return resp - @wait_container_is_ready() def configure(self) -> None: if not self.server_running(): raise WireMockContainerException( @@ -221,6 +220,7 @@ def get_url(self, path: str) -> str: def start(self, cmd: Optional[str] = None) -> "WireMockContainer": self.with_command(cmd) super().start() + self.waiting_for(HttpWaitStrategy(self.https_server_port if self.secure else self.http_server_port)) self.configure() return self