diff options
| author | Jonathan Lange <jml@mumak.net> | 2012-04-10 14:39:10 +0100 |
|---|---|---|
| committer | Jonathan Lange <jml@mumak.net> | 2012-04-10 14:39:10 +0100 |
| commit | 3cbc2211d91877f2c24c9bed2f50c5a68cfa9deb (patch) | |
| tree | 89e436e0dbb6fe7061b9b7414a62b41224fbbdb1 /python/subunit/tests | |
| parent | 8ff7d39c1e1e247d860053026d6fd0867379adb0 (diff) | |
| download | subunit-git-3cbc2211d91877f2c24c9bed2f50c5a68cfa9deb.tar.gz | |
Make sure all of our predicates support tags.
Diffstat (limited to 'python/subunit/tests')
| -rw-r--r-- | python/subunit/tests/test_subunit_filter.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/python/subunit/tests/test_subunit_filter.py b/python/subunit/tests/test_subunit_filter.py index 83b9240..5bbf581 100644 --- a/python/subunit/tests/test_subunit_filter.py +++ b/python/subunit/tests/test_subunit_filter.py @@ -151,6 +151,8 @@ xfail todo def test_filter_predicate(self): """You can filter by predicate callbacks""" + # 0.0.7 and earlier did not support the 'tags' parameter, so we need + # to test that we still support behaviour without it. filtered_result = unittest.TestResult() def filter_cb(test, outcome, err, details): return outcome == 'success' @@ -161,6 +163,18 @@ xfail todo # Only success should pass self.assertEqual(1, filtered_result.testsRun) + def test_filter_predicate_with_tags(self): + """You can filter by predicate callbacks that accept tags""" + filtered_result = unittest.TestResult() + def filter_cb(test, outcome, err, details, tags): + return outcome == 'success' + result_filter = TestResultFilter(filtered_result, + filter_predicate=filter_cb, + filter_success=False) + self.run_tests(result_filter) + # Only success should pass + self.assertEqual(1, filtered_result.testsRun) + def test_time_ordering_preserved(self): # Passing a subunit stream through TestResultFilter preserves the # relative ordering of 'time' directives and any other subunit |
