diff options
| author | Jonathan Lange <jml@mumak.net> | 2012-03-27 12:17:37 +0100 |
|---|---|---|
| committer | Jonathan Lange <jml@mumak.net> | 2012-03-27 12:17:37 +0100 |
| commit | 17222a2310bd02ef841c0c6bdcbb49c484f07e6d (patch) | |
| tree | e7e58d4151c75756e2e9ba6da04b5f39dbbce862 /python/subunit | |
| parent | 661221a46057b84cbf947492609bcd77e57b24d7 (diff) | |
| download | subunit-17222a2310bd02ef841c0c6bdcbb49c484f07e6d.tar.gz | |
Factor out subunit-notify
Diffstat (limited to 'python/subunit')
| -rw-r--r-- | python/subunit/filters.py | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/python/subunit/filters.py b/python/subunit/filters.py index a221bf7..dc3fd8a 100644 --- a/python/subunit/filters.py +++ b/python/subunit/filters.py @@ -98,15 +98,7 @@ def filter_by_result(result_factory, output_path, passthrough, forward, return result -def _default_post_run(result): - if result.wasSuccessful(): - sys.exit(0) - else: - sys.exit(1) - - -def run_filter_script(result_factory, description, - post_run_hook=_default_post_run): +def run_filter_script(result_factory, description, post_run_hook=None): """Main function for simple subunit filter scripts. Many subunit filter scripts take a stream of subunit input and use a @@ -125,4 +117,9 @@ def run_filter_script(result_factory, description, result = filter_by_result( result_factory, options.output_to, not options.no_passthrough, options.forward) - post_run_hook(result) + if post_run_hook: + post_run_hook(result) + if result.wasSuccessful(): + sys.exit(0) + else: + sys.exit(1) |
