from subunit.filters import filter_by_result
from subunit.test_results import (
and_predicates,
- _make_tag_filter,
+ make_tag_filter,
TestResultFilter,
)
regexp_filter = _make_regexp_filter(
options.with_regexps, options.without_regexps)
- tag_filter = _make_tag_filter(options.with_tags, options.without_tags)
+ tag_filter = make_tag_filter(options.with_tags, options.without_tags)
filter_predicate = and_predicates([regexp_filter, tag_filter])
filter_by_result(
return lambda *args, **kwargs: all(p(*args, **kwargs) for p in predicates)
-def _make_tag_filter(with_tags, without_tags):
+def make_tag_filter(with_tags, without_tags):
"""Make a callback that checks tests against tags."""
with_tags = with_tags and set(with_tags) or None
from testtools.testresult.doubles import ExtendedTestResult
import subunit
-from subunit.test_results import _make_tag_filter, TestResultFilter
+from subunit.test_results import make_tag_filter, TestResultFilter
class TestTestResultFilter(TestCase):
self.assertEqual(4, filtered_result.testsRun)
def test_tag_filter(self):
- tag_filter = _make_tag_filter(['global'], ['local'])
+ tag_filter = make_tag_filter(['global'], ['local'])
result = ExtendedTestResult()
result_filter = TestResultFilter(
result, filter_success=False, filter_predicate=tag_filter)
self.assertEquals(tests_expected, tests_included)
def test_tags_tracked_correctly(self):
- tag_filter = _make_tag_filter(['a'], [])
+ tag_filter = make_tag_filter(['a'], [])
result = ExtendedTestResult()
result_filter = TestResultFilter(
result, filter_success=False, filter_predicate=tag_filter)