def strip_pytest_cov_testname(testname: str) -> str:
    """Strip ends of pytest-cov produced testnames"""
    if testname.endswith("|teardown"):
        return testname[:-9]
    if testname.endswith("|setup"):
        return testname[:-6]
    if testname.endswith("|run"):
        return testname[:-4]
    return testname