test.py 文件源码

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

项目:django-wechat-api 作者: crazy-canux 项目源码 文件源码
def execute(self, *args, **options):
        if options['verbosity'] > 0:
            # ensure that deprecation warnings are displayed during testing
            # the following state is assumed:
            # logging.capturewarnings is true
            # a "default" level warnings filter has been added for
            # DeprecationWarning. See django.conf.LazySettings._configure_logging
            logger = logging.getLogger('py.warnings')
            handler = logging.StreamHandler()
            logger.addHandler(handler)
        super(Command, self).execute(*args, **options)
        if options['verbosity'] > 0:
            # remove the testing-specific handler
            logger.removeHandler(handler)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号