Skip to content

Commit dc9df40

Browse files
apparently this matters now
1 parent ca71a4e commit dc9df40

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

core/testcontainers/core/waiting_utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from typing import Any, Callable, Optional, Protocol, TypeVar, Union, cast
2121

2222
import wrapt
23+
from typing_extensions import Self
2324

2425
from testcontainers.core.config import testcontainers_config
2526
from testcontainers.core.utils import setup_logger
@@ -77,23 +78,23 @@ def __init__(self) -> None:
7778
self._poll_interval: float = testcontainers_config.sleep_time
7879
self._transient_exceptions: list[type[Exception]] = [*TRANSIENT_EXCEPTIONS]
7980

80-
def with_startup_timeout(self, timeout: Union[int, timedelta]) -> "WaitStrategy":
81+
def with_startup_timeout(self, timeout: Union[int, timedelta]) -> Self:
8182
"""Set the maximum time to wait for the container to be ready."""
8283
if isinstance(timeout, timedelta):
8384
self._startup_timeout = float(int(timeout.total_seconds()))
8485
else:
8586
self._startup_timeout = float(timeout)
8687
return self
8788

88-
def with_poll_interval(self, interval: Union[float, timedelta]) -> "WaitStrategy":
89+
def with_poll_interval(self, interval: Union[float, timedelta]) -> Self:
8990
"""Set how frequently to check if the container is ready."""
9091
if isinstance(interval, timedelta):
9192
self._poll_interval = interval.total_seconds()
9293
else:
9394
self._poll_interval = interval
9495
return self
9596

96-
def with_transient_exceptions(self, *transient_exceptions: type[Exception]) -> "WaitStrategy":
97+
def with_transient_exceptions(self, *transient_exceptions: type[Exception]) -> Self:
9798
self._transient_exceptions.extend(transient_exceptions)
9899
return self
99100

0 commit comments

Comments
 (0)