From: =?utf-8?q?Timo_R=C3=B6hling?= <roehling@debian.org>
Date: Thu, 30 May 2024 23:20:42 +0200
Subject: Workaround for pytest 8.2

---
 libcloud/test/__init__.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libcloud/test/__init__.py b/libcloud/test/__init__.py
index 37a74b2..e3b2fd1 100644
--- a/libcloud/test/__init__.py
+++ b/libcloud/test/__init__.py
@@ -108,6 +108,10 @@ class MockHttp(LibcloudConnection):
         # within a response
         if isinstance(self, unittest.TestCase):
             unittest.TestCase.__init__(self, "__init__")
+            # Workaround for empty unittest.TestCase instantiation
+            if len(args) < 2 and ("host" not in kwargs or "port" not in kwargs):
+                args = []
+                kwargs = {"host": "dummy", "port": 9}
         super().__init__(*args, **kwargs)
 
     def _get_request(self, method, url, body=None, headers=None):
