summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2022-12-11 21:31:48 +0000
committerGitHub <noreply@github.com>2022-12-11 21:31:48 +0000
commitf05a16b94f135a6262667aeb7591487e8eefafa7 (patch)
tree57cd48e30d93b151e2e73d5043a730ffd441f082
parent0ce63319c147dedfc19d40b1b73d7cf8df74ef41 (diff)
parent358cdc8d2bf911e9be6ff8733c98e862627ecc8a (diff)
downloadzope-interface-5.x.tar.gz
Merge pull request #265 from cjwatson/return-None-from-test-case5.x
Fix test deprecation warning on Python 3.11
-rw-r--r--CHANGES.rst2
-rw-r--r--src/zope/interface/tests/test_ro.py11
2 files changed, 9 insertions, 4 deletions
diff --git a/CHANGES.rst b/CHANGES.rst
index cb6040c..fdfea8c 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -5,6 +5,8 @@
5.5.3 (unreleased)
==================
+- Fix test deprecation warning on Python 3.11.
+
5.5.2 (2022-11-17)
==================
diff --git a/src/zope/interface/tests/test_ro.py b/src/zope/interface/tests/test_ro.py
index 5542d28..81b1b71 100644
--- a/src/zope/interface/tests/test_ro.py
+++ b/src/zope/interface/tests/test_ro.py
@@ -202,7 +202,7 @@ class Test_c3_ro(Test_ro):
from zope.interface.ro import ro
return ro(ob, **kwargs)
- def test_complex_diamond(self, base=object):
+ def _make_complex_diamond(self, base):
# https://github.com/zopefoundation/zope.interface/issues/21
O = base
class F(O):
@@ -223,10 +223,13 @@ class Test_c3_ro(Test_ro):
return A
+ def test_complex_diamond_object(self):
+ self._make_complex_diamond(object)
+
def test_complex_diamond_interface(self):
from zope.interface import Interface
- IA = self.test_complex_diamond(Interface)
+ IA = self._make_complex_diamond(Interface)
self.assertEqual(
[x.__name__ for x in IA.__iro__],
@@ -236,7 +239,7 @@ class Test_c3_ro(Test_ro):
def test_complex_diamond_use_legacy_argument(self):
from zope.interface import Interface
- A = self.test_complex_diamond(Interface)
+ A = self._make_complex_diamond(Interface)
legacy_A_iro = self._callFUT(A, use_legacy_ro=True)
self.assertNotEqual(A.__iro__, legacy_A_iro)
@@ -246,7 +249,7 @@ class Test_c3_ro(Test_ro):
def test_complex_diamond_compare_legacy_argument(self):
from zope.interface import Interface
- A = self.test_complex_diamond(Interface)
+ A = self._make_complex_diamond(Interface)
computed_A_iro = self._callFUT(A, log_changed_ro=True)
# It matches, of course, but we did log a warning.
self.assertEqual(tuple(computed_A_iro), A.__iro__)