From a61e333822723ca40c9e7423228bd1f240eddd91 Mon Sep 17 00:00:00 2001 From: Jonathan Lange Date: Fri, 20 Apr 2012 12:32:41 +0100 Subject: Flush global tags too. --- python/subunit/tests/test_test_results.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'python/subunit/tests') diff --git a/python/subunit/tests/test_test_results.py b/python/subunit/tests/test_test_results.py index 09b4c2f..3c4f686 100644 --- a/python/subunit/tests/test_test_results.py +++ b/python/subunit/tests/test_test_results.py @@ -212,6 +212,25 @@ class TestTagCollapsingDecorator(TestCase): ('startTest', self), ], result._events) + def test_tags_collapsed_outside_of_tests_are_flushed(self): + result = ExtendedTestResult() + tag_collapser = subunit.test_results.TagCollapsingDecorator(result) + tag_collapser.startTestRun() + tag_collapser.tags(set(['a']), set()) + tag_collapser.tags(set(['b']), set()) + tag_collapser.startTest(self) + tag_collapser.addSuccess(self) + tag_collapser.stopTest(self) + tag_collapser.stopTestRun() + self.assertEquals( + [('startTestRun',), + ('tags', set(['a', 'b']), set([])), + ('startTest', self), + ('addSuccess', self), + ('stopTest', self), + ('stopTestRun',), + ], result._events) + def test_tags_forwarded_after_tests(self): test = subunit.RemotedTestCase('foo') result = ExtendedTestResult() -- cgit v1.2.1