File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -691,12 +691,26 @@ def test_resize_maximize_unmaximize(
691691 @classmethod
692692 def get_parametrization (cls , name ):
693693 p = load_params (PARAMS_DIR / f'{ name } .gen' ).filter ('class' , cls )
694+
694695 # Reduce monitor config changes - more like in real use, and faster
695696 # Note: last order_by() has highest priority
696697 p = p .order_by ('monitor1_scale' ).order_by ('monitor0_scale' )
697698 p = p .order_by ('primary_monitor' )
698- p = p .order_by ('layout_mode' ) # Change requires restarting the app
699- p = p .order_by ('gdk_backend' ) # Change requires restarting the app
699+
700+ # Hack: reduce app restarts by altering sort order
701+ # So if the first test method ends with layout_mode=PHYSICAL,
702+ # the second one will start with layout_mode=PHYSICAL
703+ if '_testmethods' not in cls .__dict__ :
704+ cls ._testmethods = []
705+
706+ if name not in cls ._testmethods :
707+ cls ._testmethods .append (name )
708+
709+ reverse = cls ._testmethods .index (name ) % 2 == 1
710+
711+ p = p .order_by ('layout_mode' , reverse ) # Change requires restarting the app
712+ p = p .order_by ('gdk_backend' , reverse ) # Change requires restarting the app
713+
700714 return p
701715
702716 def pytest_generate_tests (self , metafunc ):
You can’t perform that action at this time.
0 commit comments