zopefoundation/zope.schema

DeprecationWarnings with Python 3.11a1

Closed this issue · 0 comments

What I did:

tox -e py311

What I expect to happen:

Successful run without deprecation warnings.

What actually happened:

Successful run (yeah!) but a load of deprecation warnings like this:

.../lib/python3.11/unittest/case.py:646: DeprecationWarning: It is deprecated to return a value!=None from a test case (<bound method InterfaceConformanceTestsMixin.test_class_conforms_to_iface of <zope.schema.tests.test__bootstrapfields.BoolTests testMethod=test_class_conforms_to_iface>>)
  return self.run(*args, **kwds)

The reason seems to be:

def test_class_conforms_to_iface(self):
from zope.interface.verify import verifyClass
cls = self._getTargetClass()
__traceback_info__ = cls
for iface in self._getTargetInterfaces():
verifyClass(iface, cls)
return verifyClass
def test_instance_conforms_to_iface(self):
from zope.interface.verify import verifyObject
instance = self._makeOne()
__traceback_info__ = instance
for iface in self._getTargetInterfaces():
verifyObject(iface, instance)
return verifyObject

Those methods are used in some child classes for super calls but in others they are not overwritten.

What version of Python and Zope/Addons I am using:

Python 3.11a1 on master of zope.schema.