Exemplo n.º 1
0
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:
        coverallz = Coveralls(config_file=options['--rcfile'])
        if not options['debug']:
            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)
        else:
            log.info("Testing coveralls-python...")
            coverallz.wear(dry_run=True)
    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
Exemplo n.º 2
0
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:
        coverallz = Coveralls(config_file=options['--rcfile'])
        if not options['debug']:
            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)
        else:
            log.info("Testing coveralls-python...")
            coverallz.wear(dry_run=True)
    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
Exemplo n.º 3
0
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:
        coverallz = Coveralls()
        if not options["debug"]:
            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)
        else:
            log.info("Testing coveralls-python...")
            coverallz.wear(dry_run=True)
    except KeyboardInterrupt:  # pragma: no cover
        log.info("Aborted")
    except CoverallsException as e:
        log.error(e)
    except Exception:  # pragma: no cover
        raise
Exemplo n.º 4
0
    def coverage_report(self):
        """
        Outputs Coverage report to screen and coverage.xml.
        """

        include = ['%s*' % package for package in self.packages]
        omit = ['*testing*']

        log.info("\n\nCoverage Report:")
        try:
            self.coverage.stop()
            self.coverage.report(include=include, omit=omit)
        except CoverageException as e:
            log.info("Coverage Exception: %s" % e)

        if os.environ.get('TRAVIS'):
            log.info("Submitting coverage to coveralls.io...")
            try:
                result = Coveralls()
                result.wear()
            except CoverallsException as e:
                log.error("Coveralls Exception: %s" % e)
Exemplo n.º 5
0
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)
        sys.exit(1)
    except KeyError as e:  # pragma: no cover
        log.error(e)
        sys.exit(2)
    except Exception:  # pragma: no cover
        raise
Exemplo n.º 6
0
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)
        sys.exit(1)
    except KeyError as e:  # pragma: no cover
        log.error(e)
        sys.exit(2)
    except Exception:  # pragma: no cover
        raise