Exemple #1
0
 def _debug(self, category, action, tokens):
     text = ""
     position = "None"
     if not len(tokens) == 0:
         text = truncate(self._as_text(tokens), 30)
         position = tokens[-1].location,
     logger.debug("GL={} {} {} {}".format(self._level, action, category,
                                          text))
Exemple #2
0
 def entry(self, file, line, column, code):
     if self._verbose:
         escaped_code = truncate(code.strip().replace("\n", r"\n"),
                                 length=self.WIDTHS[3])
         self._show(self.ENTRY,
                    file=file,
                    line=line,
                    column=column,
                    code=escaped_code)
Exemple #3
0
 def _verify_console_output(self, test_case):
     self._verify_shown(__version__)
     self._verify_shown(self._display.HEADER)
     self._verify_shown(self._display._horizontal_line())
     entries = [each.as_dictionary for each in test_case._output]
     for each_entry in entries:
         each_entry["code"] = truncate(each_entry["code"], self._display.WIDTHS[3])
         self._verify_shown(self._display.ENTRY.format(**each_entry))
     self._verify_shown(self._display.SUMMARY.format(count=len(test_case._output)))
Exemple #4
0
def log(invocation, message, **kwargs):
    data = (invocation.location.source, str(invocation.location.line),
            str(invocation.location.column),
            repr(truncate(invocation.as_text,
                          length=40)), message.format(**kwargs))
    logger.debug(" ".join(data))