diff options
author | Kirill Simonov <xi@resolvent.net> | 2016-06-15 20:28:10 -0500 |
---|---|---|
committer | Kirill Simonov <xi@resolvent.net> | 2016-06-15 20:28:10 -0500 |
commit | 491508b0429ecb4acf240e4fdc14898b9ebf5df2 (patch) | |
tree | 95470e0082978b860f95c049dcae3b0b5e58666d /tests | |
parent | a57fe5ca52d4e02936c76892138e516889573cf6 (diff) | |
download | pyyaml-491508b0429ecb4acf240e4fdc14898b9ebf5df2.tar.gz |
Raise an error when test suite failed.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/test_all.py | 2 | ||||
-rw-r--r-- | tests/lib/test_appliance.py | 3 | ||||
-rw-r--r-- | tests/lib3/test_all.py | 2 | ||||
-rw-r--r-- | tests/lib3/test_appliance.py | 3 |
4 files changed, 6 insertions, 4 deletions
diff --git a/tests/lib/test_all.py b/tests/lib/test_all.py index fec4ae4..72a5067 100644 --- a/tests/lib/test_all.py +++ b/tests/lib/test_all.py @@ -8,7 +8,7 @@ def main(args=None): if yaml.__with_libyaml__: import test_yaml_ext collections.append(test_yaml_ext) - test_appliance.run(collections, args) + return test_appliance.run(collections, args) if __name__ == '__main__': main() diff --git a/tests/lib/test_appliance.py b/tests/lib/test_appliance.py index d50d5a2..e27d25b 100644 --- a/tests/lib/test_appliance.py +++ b/tests/lib/test_appliance.py @@ -118,6 +118,7 @@ def display(results, verbose): sys.stdout.write('FAILURES: %s\n' % failures) if errors: sys.stdout.write('ERRORS: %s\n' % errors) + return not (failures or errors) def run(collections, args=None): test_functions = find_test_functions(collections) @@ -147,5 +148,5 @@ def run(collections, args=None): else: result = execute(function, [], verbose) results.append(result) - display(results, verbose=verbose) + return display(results, verbose=verbose) diff --git a/tests/lib3/test_all.py b/tests/lib3/test_all.py index fec4ae4..72a5067 100644 --- a/tests/lib3/test_all.py +++ b/tests/lib3/test_all.py @@ -8,7 +8,7 @@ def main(args=None): if yaml.__with_libyaml__: import test_yaml_ext collections.append(test_yaml_ext) - test_appliance.run(collections, args) + return test_appliance.run(collections, args) if __name__ == '__main__': main() diff --git a/tests/lib3/test_appliance.py b/tests/lib3/test_appliance.py index 81ff00b..77e0052 100644 --- a/tests/lib3/test_appliance.py +++ b/tests/lib3/test_appliance.py @@ -112,6 +112,7 @@ def display(results, verbose): sys.stdout.write('FAILURES: %s\n' % failures) if errors: sys.stdout.write('ERRORS: %s\n' % errors) + return not (failures or errors) def run(collections, args=None): test_functions = find_test_functions(collections) @@ -141,5 +142,5 @@ def run(collections, args=None): else: result = execute(function, [], verbose) results.append(result) - display(results, verbose=verbose) + return display(results, verbose=verbose) |