(self, testcase_dict)
run single testcase.
run single testcase.
run single testcase .
def _run_testcase(self, testcase_dict):
        """ run single testcase.
        """
        self.meta_datas = []
        config = testcase_dict.get("config", {})

        # each teststeps in one testcase (YAML/JSON) share the same session.
        test_runner = Runner(config, self.functions, self.http_client_session)

        tests = testcase_dict.get("teststeps", [])
        for index, test_dict in enumerate(tests):

            # override current teststep variables with former testcase output variables
            former_output_variables = self.session_context.test_variables_mapping
            if former_output_variables:
                test_dict.setdefault("variables", {})
                test_dict["variables"].update(former_output_variables)

            try:
                test_runner.run_test(test_dict)
            except Exception:
                # log exception request_type and name for locust stat
                self.exception_request_type = test_runner.exception_request_type
                self.exception_name = test_runner.exception_name
                raise
            finally:
                _meta_datas = test_runner.meta_datas
                self.meta_datas.append(_meta_datas)

        self.session_context.update_session_variables(
            test_runner.extract_output(test_runner.output)
        )
def _run_testcase ( self , testcase_dict ) : self . meta_datas = [ ] config = testcase_dict . get ( "config" , { } ) # each teststeps in one testcase (YAML/JSON) share the same session. test_runner = Runner ( config , self . functions , self . http_client_session ) tests = testcase_dict . get ( "teststeps" , [ ] ) for index , test_dict in enumerate ( tests ) : # override current teststep variables with former testcase output variables former_output_variables = self . session_context . test_variables_mapping if former_output_variables : test_dict . setdefault ( "variables" , { } ) test_dict [ "variables" ] . update ( former_output_variables ) try : test_runner . run_test ( test_dict ) except Exception : # log exception request_type and name for locust stat self . exception_request_type = test_runner . exception_request_type self . exception_name = test_runner . exception_name raise finally : _meta_datas = test_runner . meta_datas self . meta_datas . append ( _meta_datas ) self . session_context . update_session_variables ( test_runner . extract_output ( test_runner . output ) )