Skip to content

Commit

Permalink
README.md: Add URL of upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
cclauss committed Nov 1, 2019
1 parent cfc8875 commit 5d99046
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
- FILENAME=test2
- FILENAME=test3
install: pip install flake8 junit-xml yamlish
before_script: flake8 . --count --select=E9,F --show-source --statistics
before_script: flake8 . --max-line-length=88
script:
- python tap2junit/tap13.py
- python -m tap2junit -i test/fixtures/${FILENAME}.tap -o test/output/${FILENAME}.xml
Expand Down
17 changes: 9 additions & 8 deletions tap2junit/tap13.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function

# Copyright 2019, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -39,7 +37,10 @@
r"^\s*(?P<start>\d+)\.\.(?P<end>\d+)\s*(#\s*(?P<explanation>.*))?\s*$"
)
RE_TEST_LINE = re.compile(
r"^\s*(?P<result>(not\s+)?ok)\s*(?P<id>\d+)?\s*(?P<description>[^#]+)?\s*(#\s*(?P<directive>TODO|SKIP)?\s*(?P<comment>.+)?)?\s*$",
(
r"^\s*(?P<result>(not\s+)?ok)\s*(?P<id>\d+)?\s*(?P<description>[^#]+)"
r"?\s*(#\s*(?P<directive>TODO|SKIP)?\s*(?P<comment>.+)?)?\s*$"
),
re.IGNORECASE,
)
RE_EXPLANATION = re.compile(r"^\s*#\s*(?P<explanation>.+)?\s*$")
Expand Down Expand Up @@ -124,7 +125,7 @@ def _parse(self, source):
seek_plan = False

# Stop processing if tests were found before the plan
# if plan is at the end, it must be the last line -> stop processing
# if plan is at the end, it must be last line -> stop processing
if self.__tests_counter > 0:
break

Expand All @@ -138,8 +139,8 @@ def _parse(self, source):
t_attrs["id"] = int(t_attrs["id"])
if t_attrs["id"] < self.__tests_counter:
raise ValueError("Descending test id on line: %r" % line)
# according to TAP13 specs, missing tests must be handled as 'not ok'
# here we add the missing tests in sequence
# according to TAP13 specs, missing tests must be handled as
# 'not ok' so here we add the missing tests in sequence
while t_attrs["id"] > self.__tests_counter:
self.tests.append(
Test(
Expand Down Expand Up @@ -173,7 +174,7 @@ def parse(self, source):


if __name__ == "__main__":
input = """
text = """
TAP version 13
ok 1 - Input file opened
not ok 2 - First line of the input valid
Expand Down Expand Up @@ -208,7 +209,7 @@ def parse(self, source):
1..6
"""
t = TAP13()
t.parse(input)
t.parse(text)

import pprint

Expand Down

0 comments on commit 5d99046

Please sign in to comment.