Dear Maintainer,

getting rid of python3-mock in B-D and in test dependencies and applying 
attached patch
solves the problem (d/patches/0004-Adjust-test-for-Python-3.9-mock-4.0.3.patch 
needs
to be removed).

Changing this line in 0004-Adjust-test-for-Python-3.9-mock-4.0.3.patch from

 +        self.addCleanup(patch.__exit__, (None, None, None))

to:

 +        self.addCleanup(patch.__exit__, *(None, None, None))

also works (__exit__() accepts three args).

Kind Regards



--- a/cloud_sptheme/tests/test_ext_relbar_toc.py
+++ b/cloud_sptheme/tests/test_ext_relbar_toc.py
@@ -10,7 +10,7 @@
 log = logging.getLogger(__name__)
 import os
 # site
-import mock
+from unittest import mock
 # pkg
 from .utils import TestCase, unittest
 # subject
@@ -46,8 +46,8 @@
 
         # patch sphinx's _() to be noop
         patch = mock.patch.object(relbar_links, "_", side_effect=lambda s: s)
-        self.addCleanup(patch.__exit__)
-        patch.__enter__()
+        patch.start()
+        self.addCleanup(patch.stop)
 
     def test_insert_no_links(self):
         """

Reply via email to