(test_path, dot_env_path=None)
load api, testcases, .env, debugtalk.py functions.
        api/testcases folder is relative to project_working_directory

    Args:
        test_path (str): test file/folder path, locate pwd from this path.
        dot_env_path (str): specified .env file path

    Returns:
        dict: project loaded api/testcases definitions, environments and debugtalk.py functions.
load api, testcases, .env, debugtalk.py functions.
        api/testcases folder is relative to project_working_directory
load api testcases . env debugtalk . py functions . api / testcases folder is relative to project_working_directory
def load_project_tests(test_path, dot_env_path=None):
    """ load api, testcases, .env, debugtalk.py functions.
        api/testcases folder is relative to project_working_directory

    Args:
        test_path (str): test file/folder path, locate pwd from this path.
        dot_env_path (str): specified .env file path

    Returns:
        dict: project loaded api/testcases definitions, environments and debugtalk.py functions.

    """
    # locate debugtalk.py file
    debugtalk_path = locate_debugtalk_py(test_path)

    if debugtalk_path:
        # The folder contains debugtalk.py will be treated as PWD.
        project_working_directory = os.path.dirname(debugtalk_path)
    else:
        # debugtalk.py not found, use os.getcwd() as PWD.
        project_working_directory = os.getcwd()

    # add PWD to sys.path
    sys.path.insert(0, project_working_directory)

    # load .env file
    # NOTICE:
    # environment variable maybe loaded in debugtalk.py
    # thus .env file should be loaded before loading debugtalk.py
    dot_env_path = dot_env_path or os.path.join(project_working_directory, ".env")
    project_mapping["env"] = load_dot_env_file(dot_env_path)

    if debugtalk_path:
        # load debugtalk.py functions
        debugtalk_functions = load_debugtalk_functions()
    else:
        debugtalk_functions = {}

    # locate PWD and load debugtalk.py functions

    project_mapping["PWD"] = project_working_directory
    project_mapping["functions"] = debugtalk_functions

    # load api
    tests_def_mapping["api"] = load_api_folder(os.path.join(project_working_directory, "api"))
    tests_def_mapping["PWD"] = project_working_directory
def load_project_tests ( test_path , dot_env_path = None ) : # locate debugtalk.py file debugtalk_path = locate_debugtalk_py ( test_path ) if debugtalk_path : # The folder contains debugtalk.py will be treated as PWD. project_working_directory = os . path . dirname ( debugtalk_path ) else : # debugtalk.py not found, use os.getcwd() as PWD. project_working_directory = os . getcwd ( ) # add PWD to sys.path sys . path . insert ( 0 , project_working_directory ) # load .env file # NOTICE: # environment variable maybe loaded in debugtalk.py # thus .env file should be loaded before loading debugtalk.py dot_env_path = dot_env_path or os . path . join ( project_working_directory , ".env" ) project_mapping [ "env" ] = load_dot_env_file ( dot_env_path ) if debugtalk_path : # load debugtalk.py functions debugtalk_functions = load_debugtalk_functions ( ) else : debugtalk_functions = { } # locate PWD and load debugtalk.py functions project_mapping [ "PWD" ] = project_working_directory project_mapping [ "functions" ] = debugtalk_functions # load api tests_def_mapping [ "api" ] = load_api_folder ( os . path . join ( project_working_directory , "api" ) ) tests_def_mapping [ "PWD" ] = project_working_directory