diff options
author | Matthew Treinish <mtreinish@kortar.org> | 2019-12-15 14:44:53 -0500 |
---|---|---|
committer | Matthew Treinish <mtreinish@kortar.org> | 2019-12-15 14:44:53 -0500 |
commit | 87300ad826336f898a752d8d7bd10cdc5f039d08 (patch) | |
tree | b79a54e45359955a3dfaeb2d5038b0faa58e0fb4 /python | |
parent | 67fd06d9d6a673b5a59fb2c4c8c08151250ceeec (diff) | |
download | subunit-git-87300ad826336f898a752d8d7bd10cdc5f039d08.tar.gz |
Fix syntax issues
Diffstat (limited to 'python')
-rwxr-xr-x | python/subunit/filter_scripts/subunit2csv.py | 4 | ||||
-rwxr-xr-x | python/subunit/filter_scripts/subunit2gtk.py | 19 | ||||
-rwxr-xr-x | python/subunit/filter_scripts/subunit2junitxml.py | 4 | ||||
-rwxr-xr-x | python/subunit/filter_scripts/subunit2pyunit.py | 14 | ||||
-rwxr-xr-x | python/subunit/filter_scripts/subunit_1to2.py | 2 | ||||
-rwxr-xr-x | python/subunit/filter_scripts/subunit_2to1.py | 4 | ||||
-rwxr-xr-x | python/subunit/filter_scripts/subunit_filter.py | 6 | ||||
-rwxr-xr-x | python/subunit/filter_scripts/subunit_ls.py | 9 | ||||
-rwxr-xr-x | python/subunit/filter_scripts/subunit_output.py | 2 |
9 files changed, 33 insertions, 31 deletions
diff --git a/python/subunit/filter_scripts/subunit2csv.py b/python/subunit/filter_scripts/subunit2csv.py index 4802314..0a8a0de 100755 --- a/python/subunit/filter_scripts/subunit2csv.py +++ b/python/subunit/filter_scripts/subunit2csv.py @@ -22,8 +22,8 @@ from subunit.filters import run_filter_script from subunit.test_results import CsvResult -def main() - run_filter_script(lambda output:StreamToExtendedDecorator( +def main(): + run_filter_script(lambda output: StreamToExtendedDecorator( CsvResult(output)), __doc__, protocol_version=2) diff --git a/python/subunit/filter_scripts/subunit2gtk.py b/python/subunit/filter_scripts/subunit2gtk.py index 013b07a..110f2f0 100755 --- a/python/subunit/filter_scripts/subunit2gtk.py +++ b/python/subunit/filter_scripts/subunit2gtk.py @@ -6,7 +6,7 @@ # license at the users choice. A copy of both licenses are available in the # project source as Apache-2.0 and BSD. You may not use this file except in # compliance with one of these two licences. -# +# # Unless required by applicable law or agreed to in writing, software # distributed under these licenses is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -16,28 +16,28 @@ ### The GTK progress bar __init__ function is derived from the pygtk tutorial: # The PyGTK Tutorial is Copyright (C) 2001-2005 John Finlay. -# +# # The GTK Tutorial is Copyright (C) 1997 Ian Main. -# +# # Copyright (C) 1998-1999 Tony Gale. -# +# # Permission is granted to make and distribute verbatim copies of this manual # provided the copyright notice and this permission notice are preserved on all # copies. -# +# # Permission is granted to copy and distribute modified versions of this # document under the conditions for verbatim copying, provided that this # copyright notice is included exactly as in the original, and that the entire # resulting derived work is distributed under the terms of a permission notice # identical to this one. -# +# # Permission is granted to copy and distribute translations of this document # into another language, under the above conditions for modified versions. -# +# # If you are intending to incorporate this document into a published work, # please contact the maintainer, and we will make an effort to ensure that you # have the most up to date information available. -# +# # There is no guarantee that this document lives up to its intended purpose. # This is simply provided as a free resource. As such, the authors and # maintainers of the information provided within can not make any guarantee @@ -225,7 +225,8 @@ def main(): test = ByteStreamToStreamResult(sys.stdin, non_subunit_name='stdout') # Get setup while Gtk.events_pending(): - Gtk.main_iteration() + Gtk.main_iteration() + # Start IO def run_and_finish(): test.run(result) diff --git a/python/subunit/filter_scripts/subunit2junitxml.py b/python/subunit/filter_scripts/subunit2junitxml.py index 59f3c62..89167b5 100755 --- a/python/subunit/filter_scripts/subunit2junitxml.py +++ b/python/subunit/filter_scripts/subunit2junitxml.py @@ -6,7 +6,7 @@ # license at the users choice. A copy of both licenses are available in the # project source as Apache-2.0 and BSD. You may not use this file except in # compliance with one of these two licences. -# +# # Unless required by applicable law or agreed to in writing, software # distributed under these licenses is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -33,7 +33,7 @@ except ImportError: def main(): run_filter_script( - lambda output:StreamToExtendedDecorator( + lambda output: StreamToExtendedDecorator( JUnitXmlResult(output)), __doc__, protocol_version=2) diff --git a/python/subunit/filter_scripts/subunit2pyunit.py b/python/subunit/filter_scripts/subunit2pyunit.py index 89b5f26..2a040ec 100755 --- a/python/subunit/filter_scripts/subunit2pyunit.py +++ b/python/subunit/filter_scripts/subunit2pyunit.py @@ -6,7 +6,7 @@ # license at the users choice. A copy of both licenses are available in the # project source as Apache-2.0 and BSD. You may not use this file except in # compliance with one of these two licences. -# +# # Unless required by applicable law or agreed to in writing, software # distributed under these licenses is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -31,13 +31,15 @@ from subunit.test_results import CatFiles def main(): parser = OptionParser(description=__doc__) 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("--progress", action="store_true", - help="Use bzrlib's test reporter (requires bzrlib)", - default=False) + help="Use bzrlib's test reporter (requires bzrlib)", + default=False) (options, args) = parser.parse_args() test = ByteStreamToStreamResult( find_stream(sys.stdin, args), non_subunit_name='stdout') + def wrap_result(result): result = StreamToExtendedDecorator(result) if not options.no_passthrough: @@ -45,8 +47,8 @@ def main(): result.add_rule(CatFiles(sys.stdout), 'test_id', test_id=None) return result test = DecorateTestCaseResult(test, wrap_result, - before_run=methodcaller('startTestRun'), - after_run=methodcaller('stopTestRun')) + before_run=methodcaller('startTestRun'), + after_run=methodcaller('stopTestRun')) if options.progress: from bzrlib.tests import TextTestRunner from bzrlib import ui diff --git a/python/subunit/filter_scripts/subunit_1to2.py b/python/subunit/filter_scripts/subunit_1to2.py index 9725820..d59447b 100755 --- a/python/subunit/filter_scripts/subunit_1to2.py +++ b/python/subunit/filter_scripts/subunit_1to2.py @@ -6,7 +6,7 @@ # license at the users choice. A copy of both licenses are available in the # project source as Apache-2.0 and BSD. You may not use this file except in # compliance with one of these two licences. -# +# # Unless required by applicable law or agreed to in writing, software # distributed under these licenses is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the diff --git a/python/subunit/filter_scripts/subunit_2to1.py b/python/subunit/filter_scripts/subunit_2to1.py index d358f66..ed9f26e 100755 --- a/python/subunit/filter_scripts/subunit_2to1.py +++ b/python/subunit/filter_scripts/subunit_2to1.py @@ -6,7 +6,7 @@ # license at the users choice. A copy of both licenses are available in the # project source as Apache-2.0 and BSD. You may not use this file except in # compliance with one of these two licences. -# +# # Unless required by applicable law or agreed to in writing, software # distributed under these licenses is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -25,7 +25,7 @@ from testtools import ( ) from subunit import ByteStreamToStreamResult, TestProtocolClient -from subunit.filters import find_stream, run_tests_from_stream +from subunit.filters import find_stream from subunit.test_results import CatFiles diff --git a/python/subunit/filter_scripts/subunit_filter.py b/python/subunit/filter_scripts/subunit_filter.py index 7314531..0f45b88 100755 --- a/python/subunit/filter_scripts/subunit_filter.py +++ b/python/subunit/filter_scripts/subunit_filter.py @@ -7,7 +7,7 @@ # license at the users choice. A copy of both licenses are available in the # project source as Apache-2.0 and BSD. You may not use this file except in # compliance with one of these two licences. -# +# # Unless required by applicable law or agreed to in writing, software # distributed under these licenses is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -33,8 +33,6 @@ import re from testtools import ExtendedToStreamDecorator, StreamToExtendedDecorator from subunit import ( - DiscardStream, - ProtocolTestCase, StreamResultToBytes, read_test_list, ) @@ -143,7 +141,7 @@ def _make_result(output, options, predicate): fixup_expected_failures.update(read_test_list(path)) return StreamToExtendedDecorator(TestResultFilter( ExtendedToStreamDecorator( - StreamResultToBytes(output)), + StreamResultToBytes(output)), filter_error=options.error, filter_failure=options.failure, filter_success=options.success, diff --git a/python/subunit/filter_scripts/subunit_ls.py b/python/subunit/filter_scripts/subunit_ls.py index ef4c225..0eee267 100755 --- a/python/subunit/filter_scripts/subunit_ls.py +++ b/python/subunit/filter_scripts/subunit_ls.py @@ -6,7 +6,7 @@ # license at the users choice. A copy of both licenses are available in the # project source as Apache-2.0 and BSD. You may not use this file except in # compliance with one of these two licences. -# +# # Unless required by applicable law or agreed to in writing, software # distributed under these licenses is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -20,11 +20,11 @@ from optparse import OptionParser import sys from testtools import ( - CopyStreamResult, StreamToExtendedDecorator, StreamResultRouter, + CopyStreamResult, StreamResultRouter, StreamSummary) from subunit import ByteStreamToStreamResult -from subunit.filters import find_stream, run_tests_from_stream +from subunit.filters import find_stream from subunit.test_results import ( CatFiles, TestIdPrintingResult, @@ -60,5 +60,6 @@ def main(): exit_code = 1 sys.exit(exit_code) -if __name__ = '__main__': + +if __name__ == '__main__': main() diff --git a/python/subunit/filter_scripts/subunit_output.py b/python/subunit/filter_scripts/subunit_output.py index 9447ad1..d377092 100755 --- a/python/subunit/filter_scripts/subunit_output.py +++ b/python/subunit/filter_scripts/subunit_output.py @@ -21,7 +21,7 @@ import sys from subunit._output import output_main def main(): - sys.exit(output_main() + sys.exit(output_main()) if __name__ == '__main__': |