Merge lp:~jelmer/subunit/tap2subunit-lc into lp:~subunit/subunit/trunk

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Robert Collins
Approved revision: 122
Merged at revision: not available
Proposed branch: lp:~jelmer/subunit/tap2subunit-lc
Merge into: lp:~subunit/subunit/trunk
Diff against target: 58 lines (+16/-5)
2 files modified
python/subunit/__init__.py (+3/-3)
python/subunit/tests/test_tap2subunit.py (+13/-2)
To merge this branch: bzr merge lp:~jelmer/subunit/tap2subunit-lc
Reviewer Review Type Date Requested Status
Robert Collins Approve
Review via email: mp+23188@code.launchpad.net

Description of the change

Handle lowercase skip/todo in tap output.

To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) wrote :

 review: +1
 merge: approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'python/subunit/__init__.py'
2--- python/subunit/__init__.py 2010-01-16 04:33:40 +0000
3+++ python/subunit/__init__.py 2010-04-11 18:25:27 +0000
4@@ -913,7 +913,7 @@
5 subunit.write("]\n")
6 continue
7 # not a plan line, or have seen one before
8- match = re.match("(ok|not ok)(?:\s+(\d+)?)?(?:\s+([^#]*[^#\s]+)\s*)?(?:\s+#\s+(TODO|SKIP)(?:\s+(.*))?)?\n", line)
9+ match = re.match("(ok|not ok)(?:\s+(\d+)?)?(?:\s+([^#]*[^#\s]+)\s*)?(?:\s+#\s+(TODO|SKIP|skip|todo)(?:\s+(.*))?)?\n", line)
10 if match:
11 # new test, emit current one.
12 _emit_test()
13@@ -927,9 +927,9 @@
14 else:
15 description = ' ' + description
16 if directive is not None:
17- if directive == 'TODO':
18+ if directive.upper() == 'TODO':
19 result = 'xfail'
20- elif directive == 'SKIP':
21+ elif directive.upper() == 'SKIP':
22 result = 'skip'
23 if directive_comment is not None:
24 log.append(directive_comment)
25
26=== modified file 'python/subunit/tests/test_tap2subunit.py'
27--- python/subunit/tests/test_tap2subunit.py 2009-09-30 12:04:18 +0000
28+++ python/subunit/tests/test_tap2subunit.py 2010-04-11 18:25:27 +0000
29@@ -18,9 +18,7 @@
30
31 import unittest
32 from StringIO import StringIO
33-import os
34 import subunit
35-import sys
36
37
38 class TestTAP2SubUnit(unittest.TestCase):
39@@ -125,6 +123,19 @@
40 ],
41 self.subunit.getvalue().splitlines())
42
43+ def test_ok_skip_number_comment_lowercase(self):
44+ self.tap.write("ok 1 # skip no samba environment available, skipping compilation\n")
45+ self.tap.seek(0)
46+ result = subunit.TAP2SubUnit(self.tap, self.subunit)
47+ self.assertEqual(0, result)
48+ self.assertEqual([
49+ "test test 1",
50+ "skip test 1 [",
51+ "no samba environment available, skipping compilation",
52+ "]"
53+ ],
54+ self.subunit.getvalue().splitlines())
55+
56 def test_ok_number_description_SKIP_skip_comment(self):
57 # A file
58 # ok 1 foo # SKIP Not done yet

Subscribers

People subscribed via source and target branches