def set_system_testing_session(self):
        """Present form to set and trigger system testing session."""
        ### if we are in play or record mode, test sessions can't be
        ### triggered, so notify user via dialog and prevent rest of
        ### method from executing by returning earlier

        if GENERAL_NS.mode_name in ('play', 'record'):

            create_and_show_dialog(CANT_TRIGGER_TESTS_DURING_PLAY_RECORD)
            return

        ### we can't trigger a test session when there are unsaved changes;
        ###
        ### notify user of that via dialog and prevent rest of method from
        ### executing by returning earlier

        if not are_changes_saved():

            create_and_show_dialog(MUST_SAVE_OR_CLOSE_TO_TRIGGER_TESTS)
            return

        ### draw screen sized semi-transparent object,
        ### so that screen behind form appears as if
        ### unhighlighted
        blit_on_screen(UNHIGHLIGHT_SURF_MAP[SCREEN_RECT.size], (0, 0))

        ### loop until running attribute is set to False

        self.running = True
        self.loop_holder = self

        while True:

            try:

                while self.running:

                    ### perform various checkups for this frame;
                    ###
                    ### stuff like maintaing a constant framerate and more
                    SERVICES_NS.frame_checkups()

                    ### execute the handle_input/update/draw methods
                    ###
                    ### the SwitchLoopException thrown when focusing in and
                    ### out of some widgets is caught in the try clause;

                    self.loop_holder.handle_input()
                    self.loop_holder.update()
                    self.loop_holder.draw()

                ## if we leave the inner loop, exit the outer one
                break

            except SwitchLoopException as err:

                ## use the loop holder in the err
                ## attribute of same name
                self.loop_holder = err.loop_holder

            ### we don't need to catch the QuitAppException,
            ### since it is caught in the main loop


        ### blit the rect sized semitransparent obj
        ### on the screen so the form appear as if
        ### unhighlighted
        self.rect_size_semitransp_obj.draw()
Present form to set and trigger system testing session.
nodezator/editing/playback/systemtesting.py