コード例 #1
0
def runCoverage(crcpath):
    if not exists(crcpath):
        createCoveragerc(crcpath)
    elif not checkCoveragerc(crcpath):
        raise SystemExit("This folder contains a .coveragerc-file not created by Devilry.")

    managepath = join(getcwd(), "manage.py")
    commands = ["coverage", "run", managepath, "test"]

    if len(sys.argv) > 1:
        commands.append(sys.argv[1])
    call(append_pythonexec_to_command(commands))
コード例 #2
0
def runCoverage(crcpath):
    if not exists(crcpath):
        createCoveragerc(crcpath)
    elif not checkCoveragerc(crcpath):
        raise SystemExit(
            'This folder contains a .coveragerc-file not created by Devilry.')

    managepath = join(getcwd(), 'manage.py')
    commands = ["coverage", "run", managepath, "test"]

    if len(sys.argv) > 1:
        commands.append(sys.argv[1])
    call(append_pythonexec_to_command(commands))
コード例 #3
0
def checkCoveragerc(crcpath):
    coveragercfile = open(crcpath, 'r')
    line = coveragercfile.readline()
    coveragercfile.close()
    if line == '#automatically created by devilry\n':
        return True
    return False


def runCoverage(crcpath):
    if not exists(crcpath):
        createCoveragerc(crcpath)
    elif not checkCoveragerc(crcpath):
        raise SystemExit(
            'This folder contains a .coveragerc-file not created by Devilry.')

    managepath = join(getcwd(), 'manage.py')
    commands = ["coverage", "run", managepath, "test"]

    if len(sys.argv) > 1:
        commands.append(sys.argv[1])
    call(append_pythonexec_to_command(commands))


require_djangoproject()
crcpath = join(getcwd(), '.coveragerc')
runCoverage(crcpath)

if exists(crcpath):
    remove(crcpath)
コード例 #4
0
def checkCoveragerc(crcpath):
    coveragercfile = open(crcpath, "r")
    line = coveragercfile.readline()
    coveragercfile.close()
    if line == "#automatically created by devilry\n":
        return True
    return False


def runCoverage(crcpath):
    if not exists(crcpath):
        createCoveragerc(crcpath)
    elif not checkCoveragerc(crcpath):
        raise SystemExit("This folder contains a .coveragerc-file not created by Devilry.")

    managepath = join(getcwd(), "manage.py")
    commands = ["coverage", "run", managepath, "test"]

    if len(sys.argv) > 1:
        commands.append(sys.argv[1])
    call(append_pythonexec_to_command(commands))


require_djangoproject()
crcpath = join(getcwd(), ".coveragerc")
runCoverage(crcpath)

if exists(crcpath):
    remove(crcpath)
コード例 #5
0
#!/usr/bin/env python
# Check test coverage and create a html-report of the results

from common import depends, Command, require_djangoproject, getcwd, append_pythonexec_to_command
from subprocess import call
from os.path import join
from sys import argv

htmlout = join(getcwd(), 'coverage_html_report')
require_djangoproject()
depends(Command('coverage', *argv[1:]))

command = ["coverage", "html", "-i", "-d", htmlout]
call(append_pythonexec_to_command(command))