feat(core): Wait strategies foundation (#838)
Aligns testcontainers-python with the testcontainers community standard
wait strategy pattern used across Java, Go, and other implementations.
This provides a consistent developer experience and better
maintainability.
## Examples
From:
```
wait_for_logs(container, "Test Sample Image")
```
To:
```
from testcontainers.core.wait_strategies import LogMessageWaitStrategy
container.waiting_for(LogMessageWaitStrategy("Server started"))
```
## Backward Compatibility
No breaking changes - all existing code continues working
Deprecation warnings added to wait_for_logs() and
@wait_container_is_ready
Clear migration path provided in warning messages
### New:
core/testcontainers/core/wait_strategies.py - Strategy implementations
core/tests/test_wait_strategies*.py - Comprehensive test coverage
### Modified:
core/testcontainers/core/container.py - Added waiting_for() method
core/testcontainers/compose/compose.py - Added compose wait strategy
support
core/testcontainers/core/waiting_utils.py - Base classes and protocol
## Future Strategies to quickly follow
Foundation enables community-standard wait strategies:
HttpWaitStrategy, HealthcheckWaitStrategy, PortWaitStrategy,
CompositeWaitStrategy
## Testing
Unit tests with parameterized scenarios
Integration tests with real Docker containers
Protocol compliance verification
Backward compatibility validation T
Terry Smith committed
003046b9f786ad0115eeca9b69350fd7cc2663b1
Parent: d40473f
Committed by GitHub <noreply@github.com>
on 8/6/2025, 6:12:45 PM