Skip to content

Commit

Permalink
Fix test deprecation warning on Python 3.11
Browse files Browse the repository at this point in the history
Fixes #112.
  • Loading branch information
cjwatson committed Dec 23, 2022
1 parent afa7e25 commit eefd8db
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

- Drop ``zope.schema._compat`` module.

- Fix test deprecation warning on Python 3.11.
(`#112 <https://github.com/zopefoundation/zope.schema/issues/112>`_)

6.2.1 (2022-09-14)
==================

Expand Down
9 changes: 4 additions & 5 deletions src/zope/schema/tests/test__bootstrapfields.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,13 @@ def test_class_conforms_to_iface(self):
__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

def test_iface_is_first_in_sro(self):
from zope.interface import implementedBy
Expand Down Expand Up @@ -1229,17 +1227,18 @@ def _getTargetInterface(self):
return INumber

def test_class_conforms_to_iface(self):
from zope.interface.verify import verifyClass
from zope.schema._bootstrapinterfaces import IFromBytes
from zope.schema._bootstrapinterfaces import IFromUnicode
verifyClass = super(NumberTests, self).test_class_conforms_to_iface()
super(NumberTests, self).test_class_conforms_to_iface()
verifyClass(IFromUnicode, self._getTargetClass())
verifyClass(IFromBytes, self._getTargetClass())

def test_instance_conforms_to_iface(self):
from zope.interface.verify import verifyObject
from zope.schema._bootstrapinterfaces import IFromBytes
from zope.schema._bootstrapinterfaces import IFromUnicode
verifyObject = (
super(NumberTests, self).test_instance_conforms_to_iface())
super(NumberTests, self).test_instance_conforms_to_iface()
verifyObject(IFromUnicode, self._makeOne())
verifyObject(IFromBytes, self._makeOne())

Expand Down

0 comments on commit eefd8db

Please sign in to comment.