def test_report_teststatus_explicit_markup(
        self, monkeypatch: MonkeyPatch, pytester: Pytester, color_mapping, category: str
    ) -> None:
        """Test that TerminalReporter handles markup explicitly provided by
        a pytest_report_teststatus hook."""
        monkeypatch.setenv("PY_COLORS", "1")
        pytester.makeconftest(
            f"""
            def pytest_report_teststatus(report):
                return {category!r}, 'F', ('FOO', {{'red': True}})
        """
        )
        pytester.makepyfile(
            """
            def test_foobar():
                pass
        """
        )

        result = pytester.runpytest("-v")
        assert not result.stderr.lines
        result.stdout.fnmatch_lines(
            color_mapping.format_for_fnmatch(["*{red}FOO{reset}*"])
        )
Test that TerminalReporter handles markup explicitly provided by
        a pytest_report_teststatus hook.
testing/test_terminal.py