Hi Andreas Tille,
On Thu, 8 Feb 2024 10:33:11 +0100 Andreas Tille <[email protected]> wrote:
> Control: tags -1 pending
>
> Hi,
>
> I've fixed the issue reported in the bug in Git. However, Salsa CI
> shows another issue[1]:
>
> if _is_instance_mock(spec):
> > raise InvalidSpecError(f'Cannot spec a Mock object. [object={spec!r}]')
> E mock.mock.InvalidSpecError: Cannot spec a Mock object. [object=<MagicMock
> id='140613732570896'>]
> /usr/lib/python3/dist-packages/mock/mock.py:537: InvalidSpecError
>
>
> Any idea how to fix this?
>
> Kind regards
> Andreas.
please find the patch in my previous message [1]
(fix_mock_InvalidSpecError.diff)
Aside that, tests still fail because further additional changes in pytest:
...
E ModuleNotFoundError: No module named 'urllib3.request'
...
Upstream fixed those in [2]. Teared off snippet:
--- a/src/etcd/tests/unit/test_request.py
+++ b/src/etcd/tests/unit/test_request.py
@@ -79,13 +79,12 @@
If a test should be run only in this class, please override the method
there.
"""
- @mock.patch('urllib3.request.RequestMethods.request')
- def test_machines(self, mocker):
+ def test_machines(self):
""" Can request machines """
data = ['http://127.0.0.1:4001',
'http://127.0.0.1:4002', 'http://127.0.0.1:4003']
d = ','.join(data)
- mocker.return_value = self._prepare_response(200, d)
+ self.client.http.request =
mock.MagicMock(return_value=self._prepare_response(200, d))
self.assertEqual(data, self.client.machines)
@mock.patch('etcd.Client.machines', new_callable=mock.PropertyMock)
With these change I was able to build the package in a sid chroot environment.
Build is
also fine for python3.13 from experimental.
Kind Regards
[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1058364#10
[2]
https://github.com/jplana/python-etcd/commit/b8f3ad0d19626b21b08892ac910fc2e72e0001b6