示例#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))
def create_testgroups(path, numstudents, numexaminers, subject_long_name,
                      period_long_name, deliverycountrange, assignments,
                      examinerspergroup=1, studentspergroup=1):
    for a in assignments:
        args = [create_testgroups_cmd,
                '{0}.{1}'.format(path, a['shortname']),
                '--grade-plugin', 'fake',
                '--num-students', str(numstudents),
                '--num-examiners', str(numexaminers),
                '--deadline-profile', str(a['deadlineprofile']),
                '--subject-long-name', subject_long_name,
                '--period-long-name', period_long_name,
                '--examiners-per-group', str(examinerspergroup),
                '--students-per-group', str(studentspergroup),
                '--assignment-long-name', a['long_name']]
        if 'maxpoints' in a:
            args.extend(['--grade-maxpoints', str(a['maxpoints'])])
        if 'pointscale' in a:
            args.extend(['--pointscale', str(a['pointscale'])])
        if deliverycountrange:
            args.extend(['--deliverycountrange', deliverycountrange])
        #print "args: ", args
        call(append_pythonexec_to_command(args))
示例#4
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))