Пример #1
0
def setTestName(testName):
    global dsTestName
    if dsTestName:
        return
    dsTestName = testName
    _parseArgs()
    if measureCoverage:
        coverage.erase()
        coverage.start()
Пример #2
0
    def __init__(self):
        if standardArgv is None:
            _parseArgs()
        for arg in standardArgv:
            print(arg)
        if traceLevel:
            print("Tracing execution")
        if measureCoverage:
            print("Measuring coverage")
        try:
            realTestProgram = unittest.main(argv=standardArgv)
        except SystemExit, e:
            # print("done. Exception is %s" % repr(e.code))

            if not e.code and measureCoverage:
                coverage.stop()
                # Item 2 contains the list of missing statements.
                if coverage.analysis(dsTestName)[2]:
                    print("Coverage summary")
                    coverage.report([dsTestName])
                coverage.erase()
            raise