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
=== modified file 'python/subunit/__init__.py'
--- python/subunit/__init__.py 2010-01-16 04:33:40 +0000
+++ python/subunit/__init__.py 2010-04-11 18:25:27 +0000
@@ -913,7 +913,7 @@
913 subunit.write("]\n")913 subunit.write("]\n")
914 continue914 continue
915 # not a plan line, or have seen one before915 # not a plan line, or have seen one before
916 match = re.match("(ok|not ok)(?:\s+(\d+)?)?(?:\s+([^#]*[^#\s]+)\s*)?(?:\s+#\s+(TODO|SKIP)(?:\s+(.*))?)?\n", line)916 match = re.match("(ok|not ok)(?:\s+(\d+)?)?(?:\s+([^#]*[^#\s]+)\s*)?(?:\s+#\s+(TODO|SKIP|skip|todo)(?:\s+(.*))?)?\n", line)
917 if match:917 if match:
918 # new test, emit current one.918 # new test, emit current one.
919 _emit_test()919 _emit_test()
@@ -927,9 +927,9 @@
927 else:927 else:
928 description = ' ' + description928 description = ' ' + description
929 if directive is not None:929 if directive is not None:
930 if directive == 'TODO':930 if directive.upper() == 'TODO':
931 result = 'xfail'931 result = 'xfail'
932 elif directive == 'SKIP':932 elif directive.upper() == 'SKIP':
933 result = 'skip'933 result = 'skip'
934 if directive_comment is not None:934 if directive_comment is not None:
935 log.append(directive_comment)935 log.append(directive_comment)
936936
=== modified file 'python/subunit/tests/test_tap2subunit.py'
--- python/subunit/tests/test_tap2subunit.py 2009-09-30 12:04:18 +0000
+++ python/subunit/tests/test_tap2subunit.py 2010-04-11 18:25:27 +0000
@@ -18,9 +18,7 @@
1818
19import unittest19import unittest
20from StringIO import StringIO20from StringIO import StringIO
21import os
22import subunit21import subunit
23import sys
2422
2523
26class TestTAP2SubUnit(unittest.TestCase):24class TestTAP2SubUnit(unittest.TestCase):
@@ -125,6 +123,19 @@
125 ],123 ],
126 self.subunit.getvalue().splitlines())124 self.subunit.getvalue().splitlines())
127125
126 def test_ok_skip_number_comment_lowercase(self):
127 self.tap.write("ok 1 # skip no samba environment available, skipping compilation\n")
128 self.tap.seek(0)
129 result = subunit.TAP2SubUnit(self.tap, self.subunit)
130 self.assertEqual(0, result)
131 self.assertEqual([
132 "test test 1",
133 "skip test 1 [",
134 "no samba environment available, skipping compilation",
135 "]"
136 ],
137 self.subunit.getvalue().splitlines())
138
128 def test_ok_number_description_SKIP_skip_comment(self):139 def test_ok_number_description_SKIP_skip_comment(self):
129 # A file140 # A file
130 # ok 1 foo # SKIP Not done yet141 # ok 1 foo # SKIP Not done yet

Subscribers

People subscribed via source and target branches