diff options
| author | Robert Collins <robertc@robertcollins.net> | 2012-05-02 23:04:11 +1200 |
|---|---|---|
| committer | Robert Collins <robertc@robertcollins.net> | 2012-05-02 23:04:11 +1200 |
| commit | 09a69c5bc1ef7daafb2b167c43092bf94dc0dee6 (patch) | |
| tree | c43a3cb6548df891c7e304c6cc41d3ae9cb8d0e0 /python/subunit/tests | |
| parent | 33b73acea72a1799f42f3fabf2034abf2d114964 (diff) | |
| download | subunit-git-09a69c5bc1ef7daafb2b167c43092bf94dc0dee6.tar.gz | |
Restore forwarding of all time calls through TestResultFilter.
Diffstat (limited to 'python/subunit/tests')
| -rw-r--r-- | python/subunit/tests/test_subunit_filter.py | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/python/subunit/tests/test_subunit_filter.py b/python/subunit/tests/test_subunit_filter.py index 664fcb3..d716578 100644 --- a/python/subunit/tests/test_subunit_filter.py +++ b/python/subunit/tests/test_subunit_filter.py @@ -233,12 +233,38 @@ xfail todo self.maxDiff = None self.assertSequenceEqual( [('time', date_a), - ('startTest', foo), ('time', date_b), + ('startTest', foo), ('addError', foo, {}), ('stopTest', foo), ('time', date_c)], result._events) + def test_time_passes_through_filtered_tests(self): + # Passing a subunit stream through TestResultFilter preserves 'time' + # directives even if a specific test is filtered out. + date_a = datetime(year=2000, month=1, day=1, tzinfo=iso8601.UTC) + date_b = datetime(year=2000, month=1, day=2, tzinfo=iso8601.UTC) + date_c = datetime(year=2000, month=1, day=3, tzinfo=iso8601.UTC) + subunit_stream = _b('\n'.join([ + "time: %s", + "test: foo", + "time: %s", + "success: foo", + "time: %s", + ""]) % (date_a, date_b, date_c)) + result = ExtendedTestResult() + result_filter = TestResultFilter(result) + result_filter.startTestRun() + self.run_tests(result_filter, subunit_stream) + result_filter.stopTestRun() + foo = subunit.RemotedTestCase('foo') + self.maxDiff = None + self.assertSequenceEqual( + [('startTestRun',), + ('time', date_a), + ('time', date_c), + ('stopTestRun',),], result._events) + def test_skip_preserved(self): subunit_stream = _b('\n'.join([ "test: foo", |
