from pathlib import Path


def get_pt_project_name(pt_export):
    """Strip the project name from the pytest export's rootdir line"""
    with Path(pt_export).open() as pt_file:
        for line in pt_file:
            if "rootdir:" in line:
                return line.split(",")[0].split("/")[-1]