Skip to content

Commit acf6859

Browse files
committed
Merge branch 'trunk' of github.com:apache/libcloud into seifertdan-patch-1
2 parents a292dea + 1117987 commit acf6859

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

CHANGES.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,11 @@ Other / Development
139139
(#1994)
140140
[Tomaz Muraus - @Kami]
141141

142+
- Add a workaround so tests work with pytest >= 8.2. Also use latest version of
143+
pytest for running tests.
144+
(#2033)
145+
[Steve Kowalik - @s-t-e-v-e-n-k]
146+
142147
Changes in Apache Libcloud 3.8.0
143148
--------------------------------
144149

libcloud/test/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def read(self, chunk_size=None):
8787
return StringIO.read(self)
8888

8989

90-
class MockHttp(LibcloudConnection):
90+
class MockHttp(LibcloudConnection, unittest.TestCase):
9191
"""
9292
A mock HTTP client/server suitable for testing purposes. This replaces
9393
`HTTPConnection` by implementing its API and returning a mock response.
@@ -108,7 +108,11 @@ def __init__(self, *args, **kwargs):
108108
# within a response
109109
if isinstance(self, unittest.TestCase):
110110
unittest.TestCase.__init__(self, "__init__")
111-
super().__init__(*args, **kwargs)
111+
# When this class is collected, it is instantiated with no arguments,
112+
# which breaks any superclasses that expect arguments, so only
113+
# do so if we were passed any keyword arguments.
114+
if kwargs:
115+
super().__init__(*args, **kwargs)
112116

113117
def _get_request(self, method, url, body=None, headers=None):
114118
# Find a method we can use for this request

requirements-tests.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
coverage[toml]==7.2.7; python_version >= '3.8'
22
requests>=2.31.0
33
requests_mock==1.11.0
4-
pytest==8.1.1
5-
pytest-xdist==3.5.0
6-
pytest-timeout==2.2.0
7-
pytest-benchmark[histogram]==4.0.0
4+
pytest==8.3.5
5+
pytest-xdist==3.6.1
6+
pytest-timeout==2.3.1
7+
pytest-benchmark[histogram]==5.1.0
88
cryptography==44.0.2
99

1010
# NOTE: Only needed by nttcis loadbalancer driver

0 commit comments

Comments
 (0)