def parse_line(self, text): """Parse a line into whatever TAP category it belongs.""" match = self.ok.match(text) if match: return self._parse_result(True, match) match = self.not_ok.match(text) if match: return self._parse_result(False, match) if self.diagnostic.match(text): return Diagnostic(text) match = self.plan.match(text) if match: return self._parse_plan(match) match = self.bail.match(text) if match: return Bail(match.group('reason')) match = self.version.match(text) if match: return self._parse_version(match) return Unknown()
def make_bail(self, reason="Because it is busted."): return Bail(reason)