X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=tests%2Futils%2Fpython%2Ftap%2Fparser.py;fp=tests%2Futils%2Fpython%2Ftap%2Fparser.py;h=bb89fbf2f3c4f109bb529008b82c32df6b356d36;hp=67f72a0e4e72fe04ca739e4c43d488e5d4c1e432;hb=768f9bcbf4b5acd09dda85ab32c0ea30d8826136;hpb=53a47a3f01d6bfa4e940e1943e7645cb89d04cd5 diff --git a/tests/utils/python/tap/parser.py b/tests/utils/python/tap/parser.py index 67f72a0e..bb89fbf2 100644 --- a/tests/utils/python/tap/parser.py +++ b/tests/utils/python/tap/parser.py @@ -26,20 +26,26 @@ class Parser(object): """ ok = re.compile(r'^ok' + result_base, re.VERBOSE) not_ok = re.compile(r'^not\ ok' + result_base, re.VERBOSE) - plan = re.compile(r""" + plan = re.compile( + r""" ^1..(?P\d+) # Match the plan details. [^#]* # Consume any non-hash character to confirm only # directives appear with the plan details. \#? # Optional directive marker. \s* # Optional whitespace. (?P.*) # Optional directive text. - """, re.VERBOSE) + """, + re.VERBOSE, + ) diagnostic = re.compile(r'^#') - bail = re.compile(r""" + bail = re.compile( + r""" ^Bail\ out! \s* # Optional whitespace. (?P.*) # Optional reason. - """, re.VERBOSE) + """, + re.VERBOSE, + ) version = re.compile(r'^TAP version (?P\d+)$') TAP_MINIMUM_DECLARED_VERSION = 13 @@ -119,12 +125,16 @@ class Parser(object): def _parse_result(self, ok, match): """Parse a matching result line into a result instance.""" return Result( - ok, match.group('number'), match.group('description').strip(), - Directive(match.group('directive'))) + ok, + match.group('number'), + match.group('description').strip(), + Directive(match.group('directive')), + ) def _parse_version(self, match): version = int(match.group('version')) if version < self.TAP_MINIMUM_DECLARED_VERSION: - raise ValueError(_('It is an error to explicitly specify ' - 'any version lower than 13.')) + raise ValueError( + _('It is an error to explicitly specify ' 'any version lower than 13.') + ) return Version(version)