Skip to content

Commit c281a8e

Browse files
committed
Change error messages to title case.
1 parent 76a23d0 commit c281a8e

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

core/testcontainers/core/docker_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def port(self, container_id: str, port: int) -> int:
6161
"""
6262
port_mappings = self.client.api.port(container_id, port)
6363
if not port_mappings:
64-
raise ConnectionError(f'port mapping for container {container_id} and port {port} is '
64+
raise ConnectionError(f'Port mapping for container {container_id} and port {port} is '
6565
'not available')
6666
return port_mappings[0]["HostPort"]
6767

@@ -71,7 +71,7 @@ def get_container(self, container_id: str) -> Container:
7171
"""
7272
containers = self.client.api.containers(filters={'id': container_id})
7373
if not containers:
74-
raise RuntimeError(f'could not get container with id {container_id}')
74+
raise RuntimeError(f'Could not get container with id {container_id}')
7575
return containers[0]
7676

7777
def bridge_ip(self, container_id: str) -> str:

core/testcontainers/core/generic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def _create_connection_url(self, dialect: str, username: str, password: str,
4242
host: Optional[str] = None, port: Optional[int] = None,
4343
dbname: Optional[str] = None, **kwargs) -> str:
4444
if raise_for_deprecated_parameter(kwargs, "db_name", "dbname"):
45-
raise ValueError(f"unexpected arguments: {','.join(kwargs)}")
45+
raise ValueError(f"Unexpected arguments: {','.join(kwargs)}")
4646
if self._container is None:
4747
raise ContainerStartException("container has not been started")
4848
host = host or self.get_container_host_ip()

core/testcontainers/core/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,5 @@ def raise_for_deprecated_parameter(kwargs: dict, name: str, replacement: str) ->
7676
Raise an error if a dictionary of keyword arguments contains a key and suggest the replacement.
7777
"""
7878
if kwargs.pop(name, None):
79-
raise ValueError(f"use `{replacement}` instead of `{name}`")
79+
raise ValueError(f"Use `{replacement}` instead of `{name}`")
8080
return kwargs

core/testcontainers/core/waiting_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,6 @@ def wait_for_logs(container: "DockerContainer", predicate: Union[Callable, str],
102102
if predicate(stdout) or predicate(stderr):
103103
return duration
104104
if timeout and duration > timeout:
105-
raise TimeoutError("container did not emit logs satisfying predicate in %.3f seconds"
106-
% timeout)
105+
raise TimeoutError(f"Container did not emit logs satisfying predicate in {timeout:.3f} "
106+
"seconds")
107107
time.sleep(interval)

0 commit comments

Comments
 (0)