diff options
| author | Jonathan Lange <jml@mumak.net> | 2012-04-20 12:34:31 +0100 |
|---|---|---|
| committer | Jonathan Lange <jml@mumak.net> | 2012-04-20 12:34:31 +0100 |
| commit | 89f529754fbb52f5015e487261529f2b40ab2df1 (patch) | |
| tree | 92506e8b07ce279d728dd2b21787025b61682d82 /python | |
| parent | 8a53f1eb17675081780974943ab009e31fafc0ab (diff) | |
| parent | a61e333822723ca40c9e7423228bd1f240eddd91 (diff) | |
| download | subunit-git-89f529754fbb52f5015e487261529f2b40ab2df1.tar.gz | |
Merge updates from tag-collapsing-rigor.
Diffstat (limited to 'python')
| -rw-r--r-- | python/subunit/test_results.py | 2 | ||||
| -rw-r--r-- | python/subunit/tests/test_test_results.py | 19 |
2 files changed, 21 insertions, 0 deletions
diff --git a/python/subunit/test_results.py b/python/subunit/test_results.py index 465b266..fea3b07 100644 --- a/python/subunit/test_results.py +++ b/python/subunit/test_results.py @@ -248,6 +248,8 @@ class TagCollapsingDecorator(HookedTestResultDecorator): self.decorated.tags(new_tags, gone_tags) if self._current_test_tags: self._current_test_tags = set(), set() + else: + self._global_tags = set(), set() def tags(self, new_tags, gone_tags): """Handle tag instructions. 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() |
