From a8c4fecf851a65effb56ba8dac3585f21a0a240f Mon Sep 17 00:00:00 2001 From: Kanishk Pachauri Date: Sun, 16 Feb 2025 21:46:21 +0530 Subject: [PATCH] chore: run ruff formatter Signed-off-by: Kanishk Pachauri --- podman/client.py | 6 +----- podman/errors/exceptions.py | 1 + podman/tests/integration/test_system.py | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/podman/client.py b/podman/client.py index 6b95822e..546a7fd9 100644 --- a/podman/client.py +++ b/podman/client.py @@ -144,11 +144,7 @@ def from_env( "max_pool_size": max_pool_size, } - host = ( - environment.get("CONTAINER_HOST") - or environment.get("DOCKER_HOST") - or None - ) + host = environment.get("CONTAINER_HOST") or environment.get("DOCKER_HOST") or None if host is not None: kwargs["base_url"] = host diff --git a/podman/errors/exceptions.py b/podman/errors/exceptions.py index c403d95d..aaf2fb43 100644 --- a/podman/errors/exceptions.py +++ b/podman/errors/exceptions.py @@ -144,6 +144,7 @@ def __init__( class InvalidArgument(PodmanError): """Parameter to method/function was not valid.""" + class PodmanConnectionError(PodmanError): """Exception raised when connection to Podman service fails using environment configuration.""" diff --git a/podman/tests/integration/test_system.py b/podman/tests/integration/test_system.py index 08ffd5a8..1cf43af6 100644 --- a/podman/tests/integration/test_system.py +++ b/podman/tests/integration/test_system.py @@ -64,7 +64,7 @@ def test_login(self): def test_from_env(self): """integration: from_env() no error""" PodmanClient.from_env() - + def test_from_env_exceptions(self): """integration: from_env() returns exceptions""" with self.assertRaises(PodmanConnectionError):