(test_path: Text)
return debugtalk_path, project_root_directory
locate debugtalk.py path as project root directory

    Args:
        test_path: specified testfile path

    Returns:
        (str, str): debugtalk.py path, project_root_directory
locate debugtalk.py path as project root directory
locate debugtalk . py path as project root directory
def locate_project_root_directory(test_path: Text) -> Tuple[Text, Text]:
    """ locate debugtalk.py path as project root directory

    Args:
        test_path: specified testfile path

    Returns:
        (str, str): debugtalk.py path, project_root_directory

    """

    def prepare_path(path):
        if not os.path.exists(path):
            err_msg = f"path not exist: {path}"
            logger.error(err_msg)
            raise exceptions.FileNotFound(err_msg)

        if not os.path.isabs(path):
            path = os.path.join(os.getcwd(), path)

        return path

    test_path = prepare_path(test_path)

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

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

    return debugtalk_path, project_root_directory
def locate_project_root_directory ( test_path : Text ) -> Tuple [ Text , Text ] : def prepare_path ( path ) : if not os . path . exists ( path ) : err_msg = f"path not exist: {path}" logger . error ( err_msg ) raise exceptions . FileNotFound ( err_msg ) if not os . path . isabs ( path ) : path = os . path . join ( os . getcwd ( ) , path ) return path test_path = prepare_path ( test_path ) # locate debugtalk.py file debugtalk_path = locate_debugtalk_py ( test_path ) if debugtalk_path : # The folder contains debugtalk.py will be treated as project RootDir. project_root_directory = os . path . dirname ( debugtalk_path ) else : # debugtalk.py not found, use os.getcwd() as project RootDir. project_root_directory = os . getcwd ( ) return debugtalk_path , project_root_directory