Make _make_tag_filter public.
authorRobert Collins <robertc@robertcollins.net>
Thu, 3 May 2012 08:18:01 +0000 (20:18 +1200)
committerRobert Collins <robertc@robertcollins.net>
Thu, 3 May 2012 08:18:01 +0000 (20:18 +1200)
filters/subunit-filter
python/subunit/test_results.py
python/subunit/tests/test_subunit_filter.py

index 8c7592f29ac8a35fb0f926b0eb454366a071d8d7..6a1ecc9a010118915403a70bcb923abf66d4d189 100755 (executable)
@@ -39,7 +39,7 @@ from subunit import (
 from subunit.filters import filter_by_result
 from subunit.test_results import (
     and_predicates,
-    _make_tag_filter,
+    make_tag_filter,
     TestResultFilter,
     )
 
@@ -143,7 +143,7 @@ def main():
 
     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(
index 1b14c5f157fe4d3e137ee536b4f466a7fda132a6..c00a2d3e9706cf3c2011b1c35856e63ff08402b7 100644 (file)
@@ -309,7 +309,7 @@ def and_predicates(predicates):
     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
index d716578f426ac4b38572d38d1993e9bc2bcf9d28..222359ba842b3e0869d7a8a48212ee29bf5ceaee 100644 (file)
@@ -28,7 +28,7 @@ from testtools.compat import _b, BytesIO
 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):
@@ -81,7 +81,7 @@ xfail todo
         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)
@@ -94,7 +94,7 @@ xfail todo
         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)