11import pytest
2+
23from testcontainers .core .exceptions import ContainerStartException
4+ from testcontainers .generic .sql_utils import SqlConnectWaitStrategy
35from testcontainers .generic .sql import SqlContainer
46
57
68class SimpleSqlContainer (SqlContainer ):
79 """Simple concrete implementation for testing."""
810
911 def __init__ (self , image : str = "postgres:13" ):
10- super ().__init__ (image )
12+ super ().__init__ (image , wait_strategy = SqlConnectWaitStrategy () )
1113 self .username = "testuser"
1214 self .password = "testpass"
1315 self .dbname = "testdb"
@@ -27,7 +29,7 @@ def _configure(self) -> None:
2729
2830class TestSqlContainer :
2931 def test_abstract_methods_raise_not_implemented (self ):
30- container = SqlContainer ("test:latest" )
32+ container = SqlContainer ("test:latest" , SqlConnectWaitStrategy () )
3133
3234 with pytest .raises (NotImplementedError ):
3335 container .get_connection_url ()
@@ -36,7 +38,7 @@ def test_abstract_methods_raise_not_implemented(self):
3638 container ._configure ()
3739
3840 def test_transfer_seed_default_behavior (self ):
39- container = SqlContainer ("test:latest" )
41+ container = SqlContainer ("test:latest" , SqlConnectWaitStrategy () )
4042 # Should not raise an exception
4143 container ._transfer_seed ()
4244
0 commit comments