Ejemplo n.º 1
0
    def form_test_report(self, test, err=None, status=None):
        time = self._timeTaken()
        id = test.id()
        actions = test.test_actions
        priority = test.priority

        if not status:
            status = 'success'

        report = {
            'classname': id_split(id)[0],
            'name': id_split(id)[-1],
            'actions': actions,
            'time': time,
            'status': status,
            'priority': priority,
            'systemout': self._getCapturedStdout(),
            'systemerr': self._getCapturedStderr(),
        }

        if err:
            report['error'] = {
                'type': nice_classname(err[0]),
                'message': exc_message(err),
                'tb': format_exception(err),
            }

        self.testcases.append(report)
Ejemplo n.º 2
0
    def addError(self, test, err, capt=None):
        taken = self._get_time_taken()

        if issubclass(err[0], SkipTest):
            type = 'skipped'
            self.stats['skipped'] += 1
        else:
            type = 'error'
            self.stats['errors'] += 1
        tb = ''.join(traceback.format_exception(*err))
        id = test.id()
        self.results.append({
            'classname':
            ':'.join(id_split(id)[0].rsplit('.', 1)),
            'name':
            id_split(id)[-1],
            'time':
            taken,
            'type':
            type,
            'errtype':
            nice_classname(err[0]),
            'message':
            exc_message(err),
            'tb':
            tb,
        })
Ejemplo n.º 3
0
    def addError(self, test, err, capt=None):
        taken = self._get_time_taken()

        if issubclass(err[0], SkipTest):
            type = 'skipped'
            self.stats['skipped'] += 1
        else:
            type = 'error'
            self.stats['errors'] += 1
        tb = ''.join(traceback.format_exception(*err))
        test_id = test.id()
        name = id_split(test_id)[-1]
        output = self._scrap_data_(exc_message(err))
        self.results.append({
            'id': test_id,
            'name': name,
            'time': taken,
            'tags': self.findTags(test, name),
            'doc': self.findDoc(test, name),
            'type': type,
            'errtype': nice_classname(err[0]),
            'ts': datetime.datetime.utcnow().isoformat(),
            # Too much text gets put here, can make our documents too big.
            #'message': exc_message(err),
            #'tb': tb,
            'message' : output['summary'],
            'tb' : output['detail'],
        })
Ejemplo n.º 4
0
    def form_test_report(self, test, err=None, status=None):
        time = self._timeTaken()
        id = test.id()
        actions = test.test_actions
        priority = test.priority

        if not status:
            status = 'success'

        report = {
            'classname': id_split(id)[0],
            'name': id_split(id)[-1],
            'actions': actions,
            'time': time,
            'status': status,
            'priority': priority,
            'systemout': self._getCapturedStdout(),
            'systemerr': self._getCapturedStderr(),
        }

        if err:
            report['error'] = {
                'type': nice_classname(err[0]),
                'message': exc_message(err),
                'tb': format_exception(err),
            }

        self.testcases.append(report)
Ejemplo n.º 5
0
 def addFailure(self, test, err, capt=None, tb_info=None):
     taken = self._timeTaken()
     tb = ''.join(traceback.format_exception(*err))
     self.stats['failures'] += 1
     id = test.id()
     self.results.append({
         'classname': ':'.join(id_split(id)[0].rsplit('.', 1)),
         'name': id_split(id)[-1],
         'time': taken,
         'type': 'failure',
         'errtype': nice_classname(err[0]),
         'message': exc_message(err),
         'tb': tb,
     })
Ejemplo n.º 6
0
    def addError(self, test, err, capt=None):
        taken = self._timeTaken()

        if issubclass(err[0], SkipTest):
            type = 'skipped'
            self.stats['skipped'] += 1
        else:
            type = 'error'
            self.stats['errors'] += 1
        tb = ''.join(traceback.format_exception(*err))
        id = test.id()
        self.results.append({
            'classname': ':'.join(id_split(id)[0].rsplit('.', 1)),
            'name': id_split(id)[-1],
            'time': taken,
            'type': type,
            'errtype': nice_classname(err[0]),
            'message': exc_message(err),
            'tb': tb,
        })
Ejemplo n.º 7
0
 def addFailure(self, test, err, capt=None, tb_info=None):
     taken = self._get_time_taken()
     tb = ''.join(traceback.format_exception(*err))
     self.stats['failures'] += 1
     id = test.id()
     self.results.append({
         'classname':
         ':'.join(id_split(id)[0].rsplit('.', 1)),
         'name':
         id_split(id)[-1],
         'time':
         taken,
         'type':
         'failure',
         'errtype':
         nice_classname(err[0]),
         'message':
         exc_message(err),
         'tb':
         tb,
     })