Skip to content

Commit 1f05f41

Browse files
committed
fix(modules): Fix postgres deprecation warning.
Remove the `wait_container_is_ready` decorator as per deprecation warning into the new `container.waiting_for`
1 parent ce12f22 commit 1f05f41

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

modules/postgres/testcontainers/postgres/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ def __init__(
6464
self.driver = f"+{driver}" if driver else ""
6565

6666
self.with_exposed_ports(self.port)
67+
self.waiting_for(
68+
LogMessageWaitStrategy(
69+
'database system is ready to accept connections').with_startup_timeout(10)
70+
)
71+
6772

6873
def _configure(self) -> None:
6974
self.with_env("POSTGRES_USER", self.username)
@@ -87,7 +92,6 @@ def get_connection_url(self, host: Optional[str] = None, driver: Optional[str] =
8792
port=self.port,
8893
)
8994

90-
@wait_container_is_ready()
9195
def _connect(self) -> None:
9296
escaped_single_password = self.password.replace("'", "'\"'\"'")
9397
result = self.exec(

0 commit comments

Comments
 (0)