()
return locust_tests
prepare locust testcases

    Returns:
        list: testcase class list
prepare locust testcases
prepare locust testcases
def prepare_locust_tests() -> List:
    """ prepare locust testcases

    Returns:
        list: testcase class list
    """

    locust_tests = []

    for pytest_file in pytest_files:
        spec = importlib.util.spec_from_file_location("module.name", pytest_file)
        module = importlib.util.module_from_spec(spec)
        spec.loader.exec_module(module)

        for name, item in vars(module).items():

            if not is_httprunner_testcase(item):
                continue

            for _ in range(item.config.weight):
                locust_tests.append(item)

    return locust_tests
def prepare_locust_tests ( ) -> List : locust_tests = [ ] for pytest_file in pytest_files : spec = importlib . util . spec_from_file_location ( "module.name" , pytest_file ) module = importlib . util . module_from_spec ( spec ) spec . loader . exec_module ( module ) for name , item in vars ( module ) . items ( ) : if not is_httprunner_testcase ( item ) : continue for _ in range ( item . config . weight ) : locust_tests . append ( item ) return locust_tests