summaryrefslogtreecommitdiff
path: root/python/subunit/tests
diff options
context:
space:
mode:
authorJonathan Lange <jml@mumak.net>2012-04-20 17:18:26 +0100
committerJonathan Lange <jml@mumak.net>2012-04-20 17:18:26 +0100
commitaa3dd552840636a6e7e35823aaee8cca0f55bef7 (patch)
tree5960d7c65ef808ab0202ee9fd9ff59869602de79 /python/subunit/tests
parenta3002beb5cf6e89c74f91eed94d94c6e9512c176 (diff)
downloadsubunit-aa3dd552840636a6e7e35823aaee8cca0f55bef7.tar.gz
Use the TagsMixin on the predicate so local and global tags are tracked correctly.
Diffstat (limited to 'python/subunit/tests')
-rw-r--r--python/subunit/tests/test_subunit_filter.py29
1 files changed, 24 insertions, 5 deletions
diff --git a/python/subunit/tests/test_subunit_filter.py b/python/subunit/tests/test_subunit_filter.py
index 7eca4cd..d6da8ce 100644
--- a/python/subunit/tests/test_subunit_filter.py
+++ b/python/subunit/tests/test_subunit_filter.py
@@ -86,12 +86,31 @@ xfail todo
result_filter = TestResultFilter(
result, filter_success=False, filter_predicate=tag_filter)
self.run_tests(result_filter)
- test = subunit.RemotedTestCase('passed')
+ tests_included = [
+ event[1] for event in result._events if event[0] == 'startTest']
+ tests_expected = map(
+ subunit.RemotedTestCase,
+ ['passed', 'error', 'skipped', 'todo'])
+ self.assertEquals(tests_expected, tests_included)
+
+ def test_tags_tracked_correctly(self):
+ tag_filter = _make_tag_filter(['a'], [])
+ result = ExtendedTestResult()
+ result_filter = TestResultFilter(
+ result, filter_success=False, filter_predicate=tag_filter)
+ input_stream = (
+ "test: foo\n"
+ "tags: a\n"
+ "successful: foo\n"
+ "test: bar\n"
+ "successful: bar\n")
+ self.run_tests(result_filter, input_stream)
+ foo = subunit.RemotedTestCase('foo')
self.assertEquals(
- [('tags', set(['global']), set()),
- ('startTest', test),
- ('addSuccess', test),
- ('stopTest', test),
+ [('startTest', foo),
+ ('tags', set(['a']), set()),
+ ('addSuccess', foo),
+ ('stopTest', foo),
],
result._events)