當前位置: 首頁>>代碼示例>>Python>>正文


Python Coveralls.save_report方法代碼示例

本文整理匯總了Python中coveralls.Coveralls.save_report方法的典型用法代碼示例。如果您正苦於以下問題:Python Coveralls.save_report方法的具體用法?Python Coveralls.save_report怎麽用?Python Coveralls.save_report使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在coveralls.Coveralls的用法示例。


在下文中一共展示了Coveralls.save_report方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: main

# 需要導入模塊: from coveralls import Coveralls [as 別名]
# 或者: from coveralls.Coveralls import save_report [as 別名]
def main(argv=None):
    options = docopt(__doc__, argv=argv)
    if options['debug']:
        options['--verbose'] = True
    level = logging.DEBUG if options['--verbose'] else logging.INFO
    log.addHandler(logging.StreamHandler())
    log.setLevel(level)

    try:
        token_required = not options['debug'] and not options['--output']
        coverallz = Coveralls(token_required, config_file=options['--rcfile'])
        if options['--merge']:
            coverallz.merge(options['--merge'])

        if options['debug']:
            log.info("Testing coveralls-python...")
            coverallz.wear(dry_run=True)
        elif options['--output']:
            log.info('Write coverage report to file...')
            coverallz.save_report(options['--output'])
        else:
            log.info("Submitting coverage to coveralls.io...")
            result = coverallz.wear()
            log.info("Coverage submitted!")
            log.info(result['message'])
            log.info(result['url'])
            log.debug(result)
    except KeyboardInterrupt:  # pragma: no cover
        log.info('Aborted')
    except CoverallsException as e:
        log.error(e)
    except KeyError as e:  # pragma: no cover
        log.error(e)
    except Exception:  # pragma: no cover
        raise
開發者ID:manish211,項目名稱:coveralls-python,代碼行數:37,代碼來源:cli.py


注:本文中的coveralls.Coveralls.save_report方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。