diff options
| author | Jonathan Lange <jml@mumak.net> | 2012-04-20 10:54:17 +0100 |
|---|---|---|
| committer | Jonathan Lange <jml@mumak.net> | 2012-04-20 10:54:17 +0100 |
| commit | a34add828e0891ea2309141e1358bdbf3ba3fbf4 (patch) | |
| tree | a3d8465c70d8d86fcae7f5c21eed084773f7f02b /python/subunit/tests | |
| parent | 87338c132fb605881db065c20b9aa2f293946e8e (diff) | |
| download | subunit-git-a34add828e0891ea2309141e1358bdbf3ba3fbf4.tar.gz | |
Make sure tags are sent before result.
Diffstat (limited to 'python/subunit/tests')
| -rw-r--r-- | python/subunit/tests/test_subunit_filter.py | 1 | ||||
| -rw-r--r-- | python/subunit/tests/test_test_results.py | 19 |
2 files changed, 19 insertions, 1 deletions
diff --git a/python/subunit/tests/test_subunit_filter.py b/python/subunit/tests/test_subunit_filter.py index 35d4603..e04090d 100644 --- a/python/subunit/tests/test_subunit_filter.py +++ b/python/subunit/tests/test_subunit_filter.py @@ -301,7 +301,6 @@ 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 6beb57a..d11f482 100644 --- a/python/subunit/tests/test_test_results.py +++ b/python/subunit/tests/test_test_results.py @@ -238,6 +238,25 @@ class TestTagCollapsingDecorator(TestCase): ('stopTest', test)], result._events) + def test_tags_sent_before_result(self): + # Because addSuccess and friends tend to send subunit output + # immediately, and because 'tags:' before a result line means + # something different to 'tags:' after a result line, we need to be + # sure that tags are emitted before 'addSuccess' (or whatever). + result = ExtendedTestResult() + tag_collapser = subunit.test_results.TagCollapsingDecorator(result) + test = subunit.RemotedTestCase('foo') + tag_collapser.startTest(test) + tag_collapser.tags(set(['a']), set()) + tag_collapser.addSuccess(test) + tag_collapser.stopTest(test) + self.assertEquals( + [('startTest', test), + ('tags', set(['a']), set()), + ('addSuccess', test), + ('stopTest', test)], + result._events) + class TestTimeCollapsingDecorator(TestCase): |
