Comment 5 for bug 914279

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 914279] Re: MultiTestResult does not support tags

On Wed, Jan 11, 2012 at 11:24 PM, Jonathan Lange <email address hidden> wrote:
> Those tests weren't failing before, so they are no good for preventing
> regressions in this behaviour.

Those tests didn't exist before.

+ def test_tags(self):
+ # tags() does not fail the test run.
+ result = self.makeResult()
+ result.startTest(self)
+ result.tags(set([]), set([]))
...
+ def test_tags(self):
+ # Calling `tags` on a `MultiTestResult` calls `tags` on all its
+ # `TestResult`s.
+ added_tags = set(['foo', 'bar'])
+ removed_tags = set(['eggs'])
+ self.multiResult.tags(added_tags, removed_tags)
+ self.assertResultLogsEqual([('tags', added_tags, removed_tags)])
...
+ def test_tags_helper(self):
+ expected = set(['present']), set(['missing', 'going'])
+ input = set(['present']), set(['missing'])
+ self.assertEqual(
+ expected, self.result1._merge_tags(input, set(), set(['going'])))
+ expected = set(['present']), set(['missing', 'going'])
+ input = set(['present', 'going']), set(['missing'])
+ self.assertEqual(
+ expected, self.result1._merge_tags(input, set(), set(['going'])))
+ expected = set(['coming', 'present']), set(['missing'])
+ input = set(['present']), set(['missing'])
+ self.assertEqual(
+ expected, self.result1._merge_tags(input, set(['coming']), set()))
+ expected = set(['coming', 'present']), set(['missing'])
+ input = set(['present']), set(['coming', 'missing'])
+ self.assertEqual(
+ expected, self.result1._merge_tags(input, set(['coming']), set()))