Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change DockerException message to remove mention of "docker" #585

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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