Skip to content

Commit

Permalink
Change DockerException message to remove mention of "docker" (#585)
Browse files Browse the repository at this point in the history
  • Loading branch information
LewisGaul authored May 2, 2024
1 parent 8ad3a9e commit 99e93d0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion python_on_whales/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(
self.stderr: Optional[str] = stderr.decode()
command_launched_str = " ".join(command_launched)
error_msg = (
f"The docker command executed was `{command_launched_str}`.\n"
f"The command executed was `{command_launched_str}`.\n"
f"It returned with code {return_code}\n"
)
if stdout is not None:
Expand Down
4 changes: 2 additions & 2 deletions tests/python_on_whales/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def test_exception_attributes():
docker.image.tag("wrong::image", "wrong::tag")

exception = excinfo.value
assert "The docker command executed was" in str(exception)
assert "The command executed was" in str(exception)
assert exception.docker_command[1:5] == [
"image",
"tag",
Expand All @@ -28,7 +28,7 @@ def test_not_showing_password_in_exception():
with pytest.raises(DockerException) as excinfo:
docker.login(username="ignore_user", password=chosen_password)
exception = excinfo.value
assert "The docker command executed was" in str(exception)
assert "The command executed was" in str(exception)
assert chosen_password not in str(exception)
assert chosen_password not in exception.docker_command
assert exception.return_code > 0
Expand Down

0 comments on commit 99e93d0

Please sign in to comment.