Ejemplo n.º 1
0
 def __init__(self, *args, **kwargs):
     print "START HERE"
     self.r = TreeReporter(*args, **kwargs)
     self.shouldStop = self.r.shouldStop
     self.separator = self.r.separator
     self.testsRun = self.r.testsRun
     self._starting2 = False
Ejemplo n.º 2
0
 def done(self):
     self.biggest_problem_len = 0
     self.biggest_problem = None
     self._write("\r" + " " * 150 + "\n")
     TreeReporter.done(self)
     self.updateLine()
     self._write("\n")
Ejemplo n.º 3
0
 def done(self):
     self.biggest_problem_len = 0
     self.biggest_problem = None
     self._write("\r" + " " * 150 + "\n")
     TreeReporter.done(self)
     self.updateLine()
     self._write("\n")
Ejemplo n.º 4
0
 def _printErrors(self):
     """Print errors.
     """
     # Also print test coverage for the final test module, if any
     # tests has been executed.
     if self._lastTest:
         self.printCoverageSummary(str(self._lastTest[0]))
     TreeReporter._printErrors(self)
Ejemplo n.º 5
0
 def _testPrelude(self, test):
     """Print prelude to a test.
     """
     if self._lastTest:
         segments = self._getPreludeSegments(test)
         if segments[0] != self._lastTest[0]:
             # print test coverage for last test module.
             self.printCoverageSummary(str(self._lastTest[0]))
     TreeReporter._testPrelude(self, test)
Ejemplo n.º 6
0
 def done(self):
     self.biggest_problem_len = 0
     self.biggest_problem = None
     if self.isTTY():
         self._write("\r" + " " * 150 + "\n")
     elif not self.at_line_start:
         self._write("\n")
     TreeReporter.done(self)
     self.updateLine()
     self._write("\n")
Ejemplo n.º 7
0
def report_test_tree(output, flaky_tests):
    """
    Print all flaky tests as a tree.
    """
    reporter = TreeReporter(output)
    for (test, flaky) in flaky_tests:
        new_test = clone_test_with_new_id(
            test, '{}({})'.format(test.id(), ', '.join(flaky.jira_keys)))
        reporter.startTest(new_test)
        reporter.addSuccess(new_test)
        reporter.stopTest(new_test)
    reporter.done()
Ejemplo n.º 8
0
def report_test_tree(output, flaky_tests):
    """
    Print all flaky tests as a tree.
    """
    reporter = TreeReporter(output)
    for (test, flaky) in flaky_tests:
        new_test = clone_test_with_new_id(test, '{}({})'.format(test.id(), ', '.join(flaky.jira_keys)))
        reporter.startTest(new_test)
        reporter.addSuccess(new_test)
        reporter.stopTest(new_test)
    reporter.done()
Ejemplo n.º 9
0
 def __init__(self, *args, **kwargs):
     print "START HERE"
     self.r = TreeReporter(*args, **kwargs)
     self.shouldStop = self.r.shouldStop
     self.separator = self.r.separator
     self.testsRun = self.r.testsRun
     self._starting2 = False
Ejemplo n.º 10
0
 def factory(*args, **kwargs):
     """Custom factory tha apply the decorators to the TreeReporter"""
     if options.subunit:
         return SubunitReporter(*args, **kwargs)
     else:
         result = TreeReporter(*args, **kwargs)
         for decorator in reporter_decorators:
             result = decorator(result)
         return result
Ejemplo n.º 11
0
class sample_Reporter(object):
    # this class, used as a reporter on a fully-passing test suite, doesn't
    # trigger exceptions. So it is a guide to what methods are invoked on a
    # Reporter.
    def __init__(self, *args, **kwargs):
        print "START HERE"
        self.r = TreeReporter(*args, **kwargs)
        self.shouldStop = self.r.shouldStop
        self.separator = self.r.separator
        self.testsRun = self.r.testsRun
        self._starting2 = False

    def write(self, *args):
        if not self._starting2:
            self._starting2 = True
            print "FIRST WRITE"
        return self.r.write(*args)

    def startTest(self, *args, **kwargs):
        return self.r.startTest(*args, **kwargs)

    def stopTest(self, *args, **kwargs):
        return self.r.stopTest(*args, **kwargs)

    def addSuccess(self, *args, **kwargs):
        return self.r.addSuccess(*args, **kwargs)

    def printErrors(self, *args, **kwargs):
        return self.r.printErrors(*args, **kwargs)

    def writeln(self, *args, **kwargs):
        return self.r.writeln(*args, **kwargs)

    def printSummary(self, *args, **kwargs):
        print "PRINT SUMMARY"
        return self.r.printSummary(*args, **kwargs)

    def wasSuccessful(self, *args, **kwargs):
        return self.r.wasSuccessful(*args, **kwargs)
Ejemplo n.º 12
0
class sample_Reporter(object):
    # this class, used as a reporter on a fully-passing test suite, doesn't
    # trigger exceptions. So it is a guide to what methods are invoked on a
    # Reporter.
    def __init__(self, *args, **kwargs):
        print "START HERE"
        self.r = TreeReporter(*args, **kwargs)
        self.shouldStop = self.r.shouldStop
        self.separator = self.r.separator
        self.testsRun = self.r.testsRun
        self._starting2 = False

    def write(self, *args):
        if not self._starting2:
            self._starting2 = True
            print "FIRST WRITE"
        return self.r.write(*args)

    def startTest(self, *args, **kwargs):
        return self.r.startTest(*args, **kwargs)

    def stopTest(self, *args, **kwargs):
        return self.r.stopTest(*args, **kwargs)

    def addSuccess(self, *args, **kwargs):
        return self.r.addSuccess(*args, **kwargs)

    def printErrors(self, *args, **kwargs):
        return self.r.printErrors(*args, **kwargs)

    def writeln(self, *args, **kwargs):
        return self.r.writeln(*args, **kwargs)

    def printSummary(self, *args, **kwargs):
        print "PRINT SUMMARY"
        return self.r.printSummary(*args, **kwargs)

    def wasSuccessful(self, *args, **kwargs):
        return self.r.wasSuccessful(*args, **kwargs)
Ejemplo n.º 13
0
 def setUp(self) -> None:
     self.stream = StringIO()
     self.distReporter = DistReporter(TreeReporter(self.stream))
     self.test = TestCase()
Ejemplo n.º 14
0
 def __init__(self, *args, **kwargs):
     os.environ['DELUGE_REPORTER'] = 'true'
     TreeReporter.__init__(self, *args, **kwargs)
Ejemplo n.º 15
0
 def _printSummary(self):
     figleaf.stop()
     return TreeReporter._printSummary(self)
Ejemplo n.º 16
0
 def __init__(self, *args, **kwargs):
     TreeReporter.__init__(self, *args, **kwargs)
     self.trouchedMap = {}
     self.moduleFilenameMap = {}
Ejemplo n.º 17
0
 def __init__(self, *args, **kwargs):
     os.environ['DELUGE_REPORTER'] = 'true'
     TreeReporter.__init__(self, *args, **kwargs)