(self, param: Dict = None)
main entrance, discovered by pytest
main entrance, discovered by pytest
main entrance discovered by pytest
def test_start(self, param: Dict = None) -> "HttpRunner":
        """main entrance, discovered by pytest"""
        self.__init_tests__()
        self.__project_meta = self.__project_meta or load_project_meta(
            self.__config.path
        )
        self.__case_id = self.__case_id or str(uuid.uuid4())
        self.__log_path = self.__log_path or os.path.join(
            self.__project_meta.RootDir, "logs", f"{self.__case_id}.run.log"
        )
        log_handler = logger.add(self.__log_path, level="DEBUG")

        # parse config name
        config_variables = self.__config.variables
        if param:
            config_variables.update(param)
        config_variables.update(self.__session_variables)
        self.__config.name = parse_data(
            self.__config.name, config_variables, self.__project_meta.functions
        )

        if USE_ALLURE:
            # update allure report meta
            allure.dynamic.title(self.__config.name)
            allure.dynamic.description(f"TestCase ID: {self.__case_id}")

        logger.info(
            f"Start to run testcase: {self.__config.name}, TestCase ID: {self.__case_id}"
        )

        try:
            return self.run_testcase(
                TestCase(config=self.__config, teststeps=self.__teststeps)
            )
        finally:
            logger.remove(log_handler)
            logger.info(f"generate testcase log: {self.__log_path}")
def test_start ( self , param : Dict = None ) -> "HttpRunner" : self . __init_tests__ ( ) self . __project_meta = self . __project_meta or load_project_meta ( self . __config . path ) self . __case_id = self . __case_id or str ( uuid . uuid4 ( ) ) self . __log_path = self . __log_path or os . path . join ( self . __project_meta . RootDir , "logs" , f"{self.__case_id}.run.log" ) log_handler = logger . add ( self . __log_path , level = "DEBUG" ) # parse config name config_variables = self . __config . variables if param : config_variables . update ( param ) config_variables . update ( self . __session_variables ) self . __config . name = parse_data ( self . __config . name , config_variables , self . __project_meta . functions ) if USE_ALLURE : # update allure report meta allure . dynamic . title ( self . __config . name ) allure . dynamic . description ( f"TestCase ID: {self.__case_id}" ) logger . info ( f"Start to run testcase: {self.__config.name}, TestCase ID: {self.__case_id}" ) try : return self . run_testcase ( TestCase ( config = self . __config , teststeps = self . __teststeps ) ) finally : logger . remove ( log_handler ) logger . info ( f"generate testcase log: {self.__log_path}" )