From 6954432d06307b33e53bbeb11799b2f61148ef31 Mon Sep 17 00:00:00 2001 From: John Arbash Meinel Date: Tue, 24 Aug 2010 17:41:12 -0500 Subject: (bug #623642) Add --no-xfail and -F to subunit-filter. The existing --no-success only filtered out genuine success cases. Now we can filter everything down to stuff that would actually be considered a 'failure'. --- python/subunit/test_results.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'python/subunit') diff --git a/python/subunit/test_results.py b/python/subunit/test_results.py index 1c91daa..cc588d2 100644 --- a/python/subunit/test_results.py +++ b/python/subunit/test_results.py @@ -208,7 +208,7 @@ class TestResultFilter(TestResultDecorator): """ def __init__(self, result, filter_error=False, filter_failure=False, - filter_success=True, filter_skip=False, + filter_success=True, filter_skip=False, filter_xfail=False, filter_predicate=None): """Create a FilterResult object filtering to result. @@ -216,6 +216,7 @@ class TestResultFilter(TestResultDecorator): :param filter_failure: Filter out failures. :param filter_success: Filter out successful tests. :param filter_skip: Filter out skipped tests. + :param filter_xfail: Filter out expected failure tests. :param filter_predicate: A callable taking (test, outcome, err, details) and returning True if the result should be passed through. err and details may be none if no error or extra @@ -227,6 +228,7 @@ class TestResultFilter(TestResultDecorator): self._filter_failure = filter_failure self._filter_success = filter_success self._filter_skip = filter_skip + self._filter_xfail = filter_xfail if filter_predicate is None: filter_predicate = lambda test, outcome, err, details: True self.filter_predicate = filter_predicate @@ -270,7 +272,8 @@ class TestResultFilter(TestResultDecorator): self._filtered() def addExpectedFailure(self, test, err=None, details=None): - if self.filter_predicate(test, 'expectedfailure', err, details): + if (not self._filter_xfail and + self.filter_predicate(test, 'expectedfailure', err, details)): self.decorated.startTest(test) return self.decorated.addExpectedFailure(test, err, details=details) -- cgit v1.2.1 From 9ce3f298dbe17b500879a32b53f440635d522b0f Mon Sep 17 00:00:00 2001 From: Jonathan Lange Date: Tue, 26 Jul 2011 22:58:00 +0100 Subject: Fix Python 3 syntax error. --- python/subunit/run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'python/subunit') diff --git a/python/subunit/run.py b/python/subunit/run.py index b390de3..51d6837 100755 --- a/python/subunit/run.py +++ b/python/subunit/run.py @@ -49,7 +49,7 @@ class SubunitTestProgram(TestProgram): def usageExit(self, msg=None): if msg: - print msg + print (msg) usage = {'progName': self.progName, 'catchbreak': '', 'failfast': '', 'buffer': ''} if self.failfast != False: -- cgit v1.2.1 From fcd3881178765d82d57970f47e57185352af0b9a Mon Sep 17 00:00:00 2001 From: Martin Date: Sun, 7 Aug 2011 17:29:59 +0100 Subject: Couple of spelling corrections to python subunit module docstring --- python/subunit/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'python/subunit') diff --git a/python/subunit/__init__.py b/python/subunit/__init__.py index 414b368..b4c9397 100644 --- a/python/subunit/__init__.py +++ b/python/subunit/__init__.py @@ -59,12 +59,12 @@ and newer). The ``tags(new_tags, gone_tags)`` method is called (if present) to add or remove tags in the test run that is currently executing. If called when no test is in progress (that is, if called outside of the ``startTest``, -``stopTest`` pair), the the tags apply to all sebsequent tests. If called +``stopTest`` pair), the the tags apply to all subsequent tests. If called when a test is in progress, then the tags only apply to that test. The ``time(a_datetime)`` method is called (if present) when a ``time:`` directive is encountered in a Subunit stream. This is used to tell a TestResult -about the time that events in the stream occured at, to allow reconstructing +about the time that events in the stream occurred at, to allow reconstructing test timing from a stream. The ``progress(offset, whence)`` method controls progress data for a stream. -- cgit v1.2.1