def pytest_configure(config: "Config") -> None:
    """Optional tests are markers.

    Use the syntax in https://docs.pytest.org/en/stable/mark.html#registering-marks.
    """
    ot_ini = config.inicfg.get("optional-tests") or []
    ot_markers = set()
    ot_run: set[str] = set()
    if isinstance(ot_ini, str):
        ot_ini = ot_ini.strip().split("\n")
    marker_re = re.compile(r"^\s*(?P<no>no_)?(?P<marker>\w+)(:\s*(?P<description>.*))?")
    for ot in ot_ini:
        m = marker_re.match(ot)
        if not m:
            raise ValueError(f"{ot!r} doesn't match pytest marker syntax")

        marker = (m.group("no") or "") + m.group("marker")
        description = m.group("description")
        config.addinivalue_line("markers", f"{marker}: {description}")
        config.addinivalue_line(
            "markers", f"{no(marker)}: run when `{marker}` not passed"
        )
        ot_markers.add(marker)

    # collect requested optional tests
    passed_args = config.getoption("run_optional")
    if passed_args:
        ot_run.update(itertools.chain.from_iterable(a.split(",") for a in passed_args))
    ot_run |= {no(excluded) for excluded in ot_markers - ot_run}
    ot_markers |= {no(m) for m in ot_markers}

    log.info("optional tests to run: %s", ot_run)
    unknown_tests = ot_run - ot_markers
    if unknown_tests:
        raise ValueError(f"Unknown optional tests wanted: {unknown_tests!r}")

    store = config._store
    store[ALL_POSSIBLE_OPTIONAL_MARKERS] = frozenset(ot_markers)
    store[ENABLED_OPTIONAL_MARKERS] = frozenset(ot_run)
Optional tests are markers.

    Use the syntax in https://docs.pytest.org/en/stable/mark.html#registering-marks.
    
tests/optional.py