Beispiel #1
0
    def output_test_case_result(self, test_case, level):
        name = test_case.pretty_name
        if level > 0:
            name = u'{0} {1}'.format(self.separator, name)

        status, name = self.get_test_case_status(test_case, name)

        self.output(name, level, status)
        print_test_args(test_case.execute_kwargs, level, status,
                        self.use_color)

        if test_case.doc and self.output_docstrings:
            print_indent_msg(test_case.doc, level + 1, status)

        # Print error if it exists
        if test_case.error:
            for line in test_case.error:
                self.output(line, level + 2, TestStatus.FAIL)

        if status == TestStatus.FAIL or self.show_all:
            print_expects(
                test_case,
                level,
                self.use_color,
                self.use_unicode
            )
Beispiel #2
0
    def start_spec(self, evt):
        level = get_item_level(evt.payload)
        name = evt.payload.name
        if level > 0:
            name = u'{0} {1}'.format(self.separator, name)

        # Output Spec name
        color = ConsoleColors.GREEN if self.use_color else None
        print_indent_msg(name, level, color=color)

        # Output Docstrings if enabled
        if evt.payload.doc and self.output_docstrings:
            print_indent_msg(evt.payload.doc, level + 1)
Beispiel #3
0
    def start_spec(self, evt):
        level = get_item_level(evt.payload)
        name = evt.payload.name
        if level > 0:
            name = u'\u221F {0}'.format(name)

        # Output Spec name
        color = ConsoleColors.GREEN if self.use_color else None
        print_indent_msg(name, level, color=color)

        # Output Docstrings if enabled
        if evt.payload.doc and self.output_docstrings:
            print_indent_msg(evt.payload.doc, level + 1)

        # Warn of duplicates
        if isinstance(evt.payload, DataDescribe) and evt.payload.dup_count:
            color = ConsoleColors.YELLOW if self.use_color else None
            print_indent_msg('Warning: Noticed {0} duplicate data '
                             'set(s)'.format(evt.payload.dup_count),
                             level + 1, color=color)
Beispiel #4
0
    def start_spec(self, evt):
        level = get_item_level(evt.payload)
        name = evt.payload.name
        if level > 0:
            name = u'{0} {1}'.format(self.separator, name)

        # Output Spec name
        color = ConsoleColors.GREEN if self.use_color else None
        print_indent_msg(name, level, color=color)

        # Output Docstrings if enabled
        if evt.payload.doc and self.output_docstrings:
            print_indent_msg(evt.payload.doc, level + 1)

        # Warn of duplicates
        if isinstance(evt.payload, DataDescribe) and evt.payload.dup_count:
            color = ConsoleColors.YELLOW if self.use_color else None
            print_indent_msg('Warning: Noticed {0} duplicate data '
                             'set(s)'.format(evt.payload.dup_count),
                             level + 1,
                             color=color)
Beispiel #5
0
 def output(self, msg, indent, status=None):
     """ Alias for print_indent_msg with color determined by status."""
     color = None
     if self.use_color:
         color = get_color_from_status(status)
     print_indent_msg(msg, indent, color)
Beispiel #6
0
 def output(self, msg, indent, status=None):
     """ Alias for print_indent_msg with color determined by status."""
     color = None
     if self.use_color:
         color = get_color_from_status(status)
     print_indent_msg(msg, indent, color)