diff options
author | Brecht Van Lommel <brecht@blender.org> | 2020-04-27 18:43:47 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2020-04-28 13:50:16 +0300 |
commit | 6cab53eaaa3abac9778d1c9ab1ac9851bee454a6 (patch) | |
tree | ad17181fea880cb18058aac2f5f71fac899b0698 /tests/python | |
parent | a7bd8356448efbeb6fc10c0e695f9490219560c5 (diff) |
Tests: fix some tests passing even if there are Python errors
Blender was not configured to exit with non-zero return code on Python errors.
A bunch of tests worked around this but not all. This removes the need for such
workarounds.
Diffstat (limited to 'tests/python')
-rw-r--r-- | tests/python/bevel_operator.py | 7 | ||||
-rw-r--r-- | tests/python/bl_alembic_io_test.py | 10 | ||||
-rw-r--r-- | tests/python/bl_blendfile_io.py | 7 | ||||
-rw-r--r-- | tests/python/bl_blendfile_liblink.py | 7 | ||||
-rw-r--r-- | tests/python/bl_constraints.py | 10 | ||||
-rw-r--r-- | tests/python/bl_load_addons.py | 9 | ||||
-rw-r--r-- | tests/python/bl_load_py_modules.py | 8 | ||||
-rw-r--r-- | tests/python/bl_mesh_modifiers.py | 12 | ||||
-rw-r--r-- | tests/python/bl_mesh_validate.py | 8 | ||||
-rw-r--r-- | tests/python/bl_pyapi_idprop_datablock.py | 10 | ||||
-rw-r--r-- | tests/python/bl_test.py | 15 | ||||
-rw-r--r-- | tests/python/boolean_operator.py | 7 | ||||
-rw-r--r-- | tests/python/modifiers.py | 7 | ||||
-rw-r--r-- | tests/python/operators.py | 8 | ||||
-rw-r--r-- | tests/python/physics_cloth.py | 7 | ||||
-rw-r--r-- | tests/python/physics_softbody.py | 7 |
16 files changed, 17 insertions, 122 deletions
diff --git a/tests/python/bevel_operator.py b/tests/python/bevel_operator.py index 3cdbeb9300b..884bd356b96 100644 --- a/tests/python/bevel_operator.py +++ b/tests/python/bevel_operator.py @@ -176,9 +176,4 @@ def main(): if __name__ == "__main__": - try: - main() - except: - import traceback - traceback.print_exc() - sys.exit(1) + main() diff --git a/tests/python/bl_alembic_io_test.py b/tests/python/bl_alembic_io_test.py index 2786a2db4d7..b9eca3057e7 100644 --- a/tests/python/bl_alembic_io_test.py +++ b/tests/python/bl_alembic_io_test.py @@ -375,12 +375,4 @@ def main(): if __name__ == "__main__": - import traceback - # So a python error exits Blender itself too - try: - main() - except SystemExit: - raise - except: - traceback.print_exc() - sys.exit(1) + main() diff --git a/tests/python/bl_blendfile_io.py b/tests/python/bl_blendfile_io.py index 0b055b9d46a..ab06e313566 100644 --- a/tests/python/bl_blendfile_io.py +++ b/tests/python/bl_blendfile_io.py @@ -77,9 +77,4 @@ def main(): if __name__ == '__main__': import sys sys.argv = [__file__] + (sys.argv[sys.argv.index("--") + 1:] if "--" in sys.argv else []) - try: - main() - except: - import traceback - traceback.print_exc() - sys.exit(1) + main() diff --git a/tests/python/bl_blendfile_liblink.py b/tests/python/bl_blendfile_liblink.py index 7d93d7c8455..d1cc7efc7fd 100644 --- a/tests/python/bl_blendfile_liblink.py +++ b/tests/python/bl_blendfile_liblink.py @@ -75,9 +75,4 @@ def main(): if __name__ == '__main__': import sys sys.argv = [__file__] + (sys.argv[sys.argv.index("--") + 1:] if "--" in sys.argv else []) - try: - main() - except: - import traceback - traceback.print_exc() - sys.exit(1) + main() diff --git a/tests/python/bl_constraints.py b/tests/python/bl_constraints.py index 13a431541bc..9fce8acc84e 100644 --- a/tests/python/bl_constraints.py +++ b/tests/python/bl_constraints.py @@ -255,12 +255,4 @@ def main(): if __name__ == "__main__": - import traceback - # So a python error exits Blender itself too - try: - main() - except SystemExit: - raise - except: - traceback.print_exc() - sys.exit(1) + main() diff --git a/tests/python/bl_load_addons.py b/tests/python/bl_load_addons.py index f0c2f3f7fdf..01f0b4d72d8 100644 --- a/tests/python/bl_load_addons.py +++ b/tests/python/bl_load_addons.py @@ -144,11 +144,4 @@ def main(): if __name__ == "__main__": - - # So a python error exits(1) - try: - main() - except: - import traceback - traceback.print_exc() - sys.exit(1) + main() diff --git a/tests/python/bl_load_py_modules.py b/tests/python/bl_load_py_modules.py index 5d1a5dd8ee0..c6ad53b1f74 100644 --- a/tests/python/bl_load_py_modules.py +++ b/tests/python/bl_load_py_modules.py @@ -234,10 +234,4 @@ def main(): if __name__ == "__main__": - # So a python error exits(1) - try: - main() - except: - import traceback - traceback.print_exc() - sys.exit(1) + main() diff --git a/tests/python/bl_mesh_modifiers.py b/tests/python/bl_mesh_modifiers.py index 80f810ffad8..746e7a183a3 100644 --- a/tests/python/bl_mesh_modifiers.py +++ b/tests/python/bl_mesh_modifiers.py @@ -842,17 +842,7 @@ if __name__ == "__main__": print("Load Handler:", bpy.data.filepath) if load_handler.first is False: bpy.app.handlers.scene_update_post.remove(load_handler) - try: - main() - import sys - sys.exit(0) - except: - import traceback - traceback.print_exc() - - # import sys - # sys.exit(1) # comment to debug - + main() else: load_handler.first = False diff --git a/tests/python/bl_mesh_validate.py b/tests/python/bl_mesh_validate.py index 47a5e5efe47..8c5d914f92a 100644 --- a/tests/python/bl_mesh_validate.py +++ b/tests/python/bl_mesh_validate.py @@ -152,10 +152,4 @@ def main(): if __name__ == "__main__": - # So a python error exits(1) - try: - main() - except: - import traceback - traceback.print_exc() - sys.exit(1) + main() diff --git a/tests/python/bl_pyapi_idprop_datablock.py b/tests/python/bl_pyapi_idprop_datablock.py index 648b63d1637..44fec6a9043 100644 --- a/tests/python/bl_pyapi_idprop_datablock.py +++ b/tests/python/bl_pyapi_idprop_datablock.py @@ -20,7 +20,6 @@ import bpy import sys import os import tempfile -import traceback import inspect from bpy.types import UIList @@ -331,11 +330,4 @@ def main(): if __name__ == "__main__": - try: - main() - except: - import traceback - - traceback.print_exc() - sys.stderr.flush() - os._exit(1) + main() diff --git a/tests/python/bl_test.py b/tests/python/bl_test.py index 173d575a912..6315ffbfa9d 100644 --- a/tests/python/bl_test.py +++ b/tests/python/bl_test.py @@ -136,12 +136,7 @@ def main(): print(" Running: '%s'" % run) print(" MD5: '%s'!" % md5) - try: - result = eval(run) - except: - import traceback - traceback.print_exc() - sys.exit(1) + result = eval(run) if write_blend is not None: print(" Writing Blend: %s" % write_blend) @@ -188,10 +183,4 @@ def main(): if __name__ == "__main__": - # So a python error exits(1) - try: - main() - except: - import traceback - traceback.print_exc() - sys.exit(1) + main() diff --git a/tests/python/boolean_operator.py b/tests/python/boolean_operator.py index b05e60eea6c..5a674c35a47 100644 --- a/tests/python/boolean_operator.py +++ b/tests/python/boolean_operator.py @@ -60,9 +60,4 @@ def main(): if __name__ == "__main__": - try: - main() - except: - import traceback - traceback.print_exc() - sys.exit(1) + main() diff --git a/tests/python/modifiers.py b/tests/python/modifiers.py index 697cddc9ba2..5e032f658af 100644 --- a/tests/python/modifiers.py +++ b/tests/python/modifiers.py @@ -255,9 +255,4 @@ def main(): if __name__ == "__main__": - try: - main() - except: - import traceback - traceback.print_exc() - sys.exit(1) + main() diff --git a/tests/python/operators.py b/tests/python/operators.py index c5b3ac745c6..626aaedc724 100644 --- a/tests/python/operators.py +++ b/tests/python/operators.py @@ -163,10 +163,4 @@ def main(): if __name__ == "__main__": - try: - main() - except: - import traceback - - traceback.print_exc() - sys.exit(1) + main() diff --git a/tests/python/physics_cloth.py b/tests/python/physics_cloth.py index 835d0aaed60..5b9151ea089 100644 --- a/tests/python/physics_cloth.py +++ b/tests/python/physics_cloth.py @@ -48,9 +48,4 @@ def main(): if __name__ == "__main__": - try: - main() - except: - import traceback - traceback.print_exc() - sys.exit(1) + main() diff --git a/tests/python/physics_softbody.py b/tests/python/physics_softbody.py index 22e35a6cc76..8d431be742c 100644 --- a/tests/python/physics_softbody.py +++ b/tests/python/physics_softbody.py @@ -48,9 +48,4 @@ def main(): if __name__ == "__main__": - try: - main() - except: - import traceback - traceback.print_exc() - sys.exit(1) + main() |