def capture_warning(
            msg: str,
            slug: str | None = None,
            once: bool = False,                 # pylint: disable=unused-argument
        ) -> None:
            """A fake implementation of Coverage._warn, to capture warnings."""
            # NOTE: we don't implement `once`.
            if slug:
                msg = f"{msg} ({slug})"
            saved_warnings.append(msg)
A fake implementation of Coverage._warn, to capture warnings.
tests/coveragetest.py