python类captureWarnings()的实例源码

test.py 文件源码 项目:tissuelab 作者: VirtualPlants 项目源码 文件源码 阅读 37 收藏 0 点赞 0 评论 0
def execute(self, *args, **options):
        if int(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 int(options['verbosity']) > 0:
            # remove the testing-specific handler
            logger.removeHandler(handler)
test.py 文件源码 项目:geekpoint 作者: Lujinghu 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
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)
test.py 文件源码 项目:django-next-train 作者: bitpixdigital 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
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)
test.py 文件源码 项目:DjangoZeroToHero 作者: RayParra 项目源码 文件源码 阅读 32 收藏 0 点赞 0 评论 0
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)
test.py 文件源码 项目:Roboism 作者: markroxor 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
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)
test.py 文件源码 项目:django-wechat-api 作者: crazy-canux 项目源码 文件源码 阅读 38 收藏 0 点赞 0 评论 0
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)


问题


面经


文章

微信
公众号

扫码关注公众号