test_interface.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:zenchmarks 作者: squeaky-pl 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号