summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJonathan Lange <jml@mumak.net>2012-03-27 11:52:50 +0100
committerJonathan Lange <jml@mumak.net>2012-03-27 11:52:50 +0100
commitefa4dc4ef3965c2b9b8d9867e9a80def71e452cd (patch)
tree178cad5309c91125ff9b25a9a732f9905867af00 /python
parent273101fd8d7abf9cd492df4c2c6c5b17c83cce99 (diff)
downloadsubunit-git-efa4dc4ef3965c2b9b8d9867e9a80def71e452cd.tar.gz
Factor out JUnitXML
Diffstat (limited to 'python')
-rw-r--r--python/subunit/filters.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/python/subunit/filters.py b/python/subunit/filters.py
index ac05af9..0bab9ed 100644
--- a/python/subunit/filters.py
+++ b/python/subunit/filters.py
@@ -21,11 +21,12 @@ from subunit import DiscardStream, ProtocolTestCase
from subunit.test_results import CsvResult
-def make_options():
- parser = OptionParser(description=__doc__)
+def make_options(description):
+ parser = OptionParser(description=description)
parser.add_option(
"--no-passthrough", action="store_true",
- help="Hide all non subunit input.", default=False, dest="no_passthrough")
+ help="Hide all non subunit input.", default=False,
+ dest="no_passthrough")
parser.add_option(
"-o", "--output-to",
help="Output the XML to this path rather than stdout.")
@@ -95,8 +96,7 @@ def filter_by_result(result_factory, output_path, no_passthrough, forward,
try:
result = result_factory(output_to)
was_successful = run_tests_from_stream(
- input_stream, result, output_to, passthrough_stream,
- forward_stream)
+ input_stream, result, passthrough_stream, forward_stream)
finally:
if output_path:
output_to.close()
@@ -106,10 +106,10 @@ def filter_by_result(result_factory, output_path, no_passthrough, forward,
return 1
-def main(result_factory):
- parser = make_options()
+def main(result_factory, description):
+ parser = make_options(description)
(options, args) = parser.parse_args()
sys.exit(
filter_by_result(
- CsvResult, options.output_to, options.no_passthrough,
+ result_factory, options.output_to, options.no_passthrough,
options.forward))