diff --git a/tests/python/ui_simulate/run.py b/tests/python/ui_simulate/run.py index a25ccddc098..64537cce971 100755 --- a/tests/python/ui_simulate/run.py +++ b/tests/python/ui_simulate/run.py @@ -6,8 +6,6 @@ Run interaction tests using event simulation. Example usage from Blender's source dir: - ./tests/python/ui_simulate/run.py --blender=./blender.bin --tests test_undo.text_editor_simple - This uses ``test_undo.py``, running the ``text_editor_simple`` function. To run all tests: @@ -16,7 +14,7 @@ To run all tests: For an editor to follow the tests: - ./lib/python/tests/ui_simulate/run.py --blender=blender.bin --tests '*' \ + ./tests/python/ui_simulate/run.py --blender=blender.bin --tests '*' \ --step-command-pre='gvim --remote-silent +{line} "{file}"' """ diff --git a/tests/python/ui_simulate/test_undo.py b/tests/python/ui_simulate/test_undo.py index 1203bd74316..e6519263bcc 100644 --- a/tests/python/ui_simulate/test_undo.py +++ b/tests/python/ui_simulate/test_undo.py @@ -1,7 +1,8 @@ # SPDX-License-Identifier: GPL-2.0-or-later -# Only access for it's methods. - +""" +This file does not run anything, it's methods are accessed for tests by: ``run.py``. +""" # FIXME: Since 2.8 or so, there is a problem with simulated events # where a popup needs the main-loop to cycle once before new events @@ -270,6 +271,9 @@ def text_editor_edit_mode_mix(): # 3D View def _view3d_startup_area_maximized(e): + """ + Set the 3D viewport and set the area full-screen so no other regions. + """ yield e.shift.f5() # 3D Viewport. yield e.ctrl.alt.space() # Full-screen. yield e.a() # Select all. @@ -277,6 +281,10 @@ def _view3d_startup_area_maximized(e): def _view3d_startup_area_single(e): + """ + Create a single area (not full screen) + this has the advantage that the window can be duplicated (not the case with a full-screened area). + """ yield e.shift.f5() # 3D Viewport. yield e.a() # Select all. yield e.delete().ret() # Delete all. @@ -444,8 +452,6 @@ def view3d_texture_paint_simple(): t.assertEqual(window.view_layer.objects.active.mode, 'TEXTURE_PAINT') yield from e.leftmouse.cursor_motion(_cursor_motion_data_x(window)) yield e.ctrl.z() # Used to crash T61172. - # test_undo.view3d_sculpt_dyntopo_simple - # test_undo.view3d_texture_paint_simple def view3d_texture_paint_complex(): @@ -597,14 +603,14 @@ def view3d_multi_mode_select(): object_names.append(window.view_layer.objects.active.name) yield from _call_menu(e, "View -> Frame All") - print(object_names) + # print(object_names) for ob_name in object_names: yield from _view3d_object_select_by_name(e, ob_name) yield - print() - print('=' * 40) - print(window.view_layer.objects.active.name, ob_name) + # print() + # print('=' * 40) + # print(window.view_layer.objects.active.name, ob_name) for ob_name in reversed(object_names): t.assertEqual(ob_name, window.view_layer.objects.active.name)