def test_description_cache_management(self):
# See https://bugs.launchpad.net/zope.interface/+bug/185974
# There was a bug where the cache used by Specification.get() was not
# cleared when the bases were changed.
from zope.interface import Interface
from zope.interface import Attribute
class I1(Interface):
a = Attribute('a')
class I2(I1):
pass
class I3(I2):
pass
self.assertTrue(I3.get('a') is I1.get('a'))
I2.__bases__ = (Interface,)
self.assertTrue(I3.get('a') is None)
评论列表
文章目录