summaryrefslogtreecommitdiff
path: root/python/subunit
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2011-05-10 09:36:17 +0200
committerJelmer Vernooij <jelmer@samba.org>2011-05-10 09:36:17 +0200
commit981cbc20546371fa50a5e779f27d0398e87a7cb3 (patch)
tree235ca0591ebc83fdf0aec7ebf8d38574dcb6f4ef /python/subunit
parent29334d4de556ca329e89fb4a34f97c63c095b135 (diff)
parentd7f31020565d999ac02e460401068d3f7c70568d (diff)
downloadsubunit-git-981cbc20546371fa50a5e779f27d0398e87a7cb3.tar.gz
Fix handling of addSkip in TestResultFilter.
Diffstat (limited to 'python/subunit')
-rw-r--r--python/subunit/test_results.py2
-rw-r--r--python/subunit/tests/test_subunit_filter.py14
2 files changed, 15 insertions, 1 deletions
diff --git a/python/subunit/test_results.py b/python/subunit/test_results.py
index e3240e0..f312416 100644
--- a/python/subunit/test_results.py
+++ b/python/subunit/test_results.py
@@ -363,7 +363,7 @@ class TestResultFilter(TestResultDecorator):
def addSkip(self, test, reason=None, details=None):
if (self.filter_predicate(test, 'skip', reason, details)):
self._buffered_calls.append(
- ('addSkip', [reason], {'details': details}))
+ ('addSkip', [test, reason], {'details': details}))
else:
self._filtered()
diff --git a/python/subunit/tests/test_subunit_filter.py b/python/subunit/tests/test_subunit_filter.py
index 87d4209..0675484 100644
--- a/python/subunit/tests/test_subunit_filter.py
+++ b/python/subunit/tests/test_subunit_filter.py
@@ -187,6 +187,20 @@ xfail todo
('stopTest', foo),
('time', date_c)], result._events)
+ def test_skip_preserved(self):
+ subunit_stream = _b('\n'.join([
+ "test: foo",
+ "skip: foo",
+ ""]))
+ result = ExtendedTestResult()
+ result_filter = TestResultFilter(result)
+ self.run_tests(result_filter, subunit_stream)
+ foo = subunit.RemotedTestCase('foo')
+ self.assertEquals(
+ [('startTest', foo),
+ ('addSkip', foo, {}),
+ ('stopTest', foo), ], result._events)
+
def test_suite():
loader = subunit.tests.TestUtil.TestLoader()