diff options
| author | Jonathan Lange <jml@mumak.net> | 2012-04-20 10:57:47 +0100 |
|---|---|---|
| committer | Jonathan Lange <jml@mumak.net> | 2012-04-20 10:57:47 +0100 |
| commit | 59b5ed77506b2ca196b9a454fc032e5897f1ca37 (patch) | |
| tree | f6b04299bf11a3773065a0c7a659d5b1f301f7ed /python | |
| parent | a34add828e0891ea2309141e1358bdbf3ba3fbf4 (diff) | |
| download | subunit-git-59b5ed77506b2ca196b9a454fc032e5897f1ca37.tar.gz | |
Properly scope tag collapsing
Diffstat (limited to 'python')
| -rw-r--r-- | python/subunit/test_results.py | 2 | ||||
| -rw-r--r-- | python/subunit/tests/test_subunit_filter.py | 1 | ||||
| -rw-r--r-- | python/subunit/tests/test_test_results.py | 16 |
3 files changed, 18 insertions, 1 deletions
diff --git a/python/subunit/test_results.py b/python/subunit/test_results.py index dec168d..1988346 100644 --- a/python/subunit/test_results.py +++ b/python/subunit/test_results.py @@ -228,7 +228,7 @@ class TagCollapsingDecorator(HookedTestResultDecorator): def stopTest(self, test): super(TagCollapsingDecorator, self).stopTest(test) - self._current_test_tags = set(), set() + self._current_test_tags = None def _before_event(self): if not self._current_test_tags: diff --git a/python/subunit/tests/test_subunit_filter.py b/python/subunit/tests/test_subunit_filter.py index e04090d..35d4603 100644 --- a/python/subunit/tests/test_subunit_filter.py +++ b/python/subunit/tests/test_subunit_filter.py @@ -301,6 +301,7 @@ xfail todo ('startTest', foo), ('addSuccess', foo), ('stopTest', foo), + ('tags', set(), set(['a'])), ], events) diff --git a/python/subunit/tests/test_test_results.py b/python/subunit/tests/test_test_results.py index d11f482..750958e 100644 --- a/python/subunit/tests/test_test_results.py +++ b/python/subunit/tests/test_test_results.py @@ -208,6 +208,22 @@ class TestTagCollapsingDecorator(TestCase): self.assertEquals( [('tags', set(['a', 'b']), set([]))], result._events) + def test_tags_forwarded_after_tests(self): + test = subunit.RemotedTestCase('foo') + result = ExtendedTestResult() + tag_collapser = subunit.test_results.TagCollapsingDecorator(result) + tag_collapser.startTest(test) + tag_collapser.addSuccess(test) + tag_collapser.stopTest(test) + tag_collapser.tags(set(['a']), set(['b'])) + self.assertEqual( + [('startTest', test), + ('addSuccess', test), + ('stopTest', test), + ('tags', set(['a']), set(['b'])), + ], + result._events) + def test_tags_collapsed_inside_of_tests(self): result = ExtendedTestResult() tag_collapser = subunit.test_results.TagCollapsingDecorator(result) |
