Skip to content

Commit 159cb43

Browse files
committed
feature: make all configuration runtime changeable
1 parent 563ab73 commit 159cb43

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

core/testcontainers/core/waiting_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def wait_for(condition: Callable[..., bool]) -> bool:
8383
def wait_for_logs(
8484
container: "DockerContainer",
8585
predicate: Union[Callable, str],
86-
timeout: float | None = None,
86+
timeout: Union[float, None] = None,
8787
interval: float = 1,
8888
predicate_streams_and: bool = False,
8989
raise_on_exit: bool = False,

core/tests/test_config.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,3 +146,23 @@ def test_get_docker_host_root(monkeypatch: pytest.MonkeyPatch) -> None:
146146
# Define a Root like Docker Client
147147
monkeypatch.setenv("DOCKER_HOST", "unix://")
148148
assert get_docker_socket() == "/var/run/docker.sock"
149+
150+
151+
def test_deprecated_settings() -> None:
152+
"""
153+
Getting deprecated settings raises a DepcrationWarning
154+
"""
155+
from testcontainers.core import config
156+
157+
with pytest.warns(DeprecationWarning):
158+
assert config.TIMEOUT
159+
160+
161+
def test_attribut_error() -> None:
162+
"""
163+
Accessing a not existing attribute raises an AttributeError
164+
"""
165+
from testcontainers.core import config
166+
167+
with pytest.raises(AttributeError):
168+
config.missing

0 commit comments

Comments
 (0)