Documentation shows incorrect pytest output color for subtests
Location: https://docs.pytest.org/en/stable/how-to/subtests.html#subtests The documentation shows:
$ pytest -q test_subtest.py
uuuuuF [100%]
where all the u characters are green (passing).
Actual behavior: Running the example produces mixed results - some u are green (passed subtests) and some are red (failed subtests).
The documentation should reflect the mixed pass/fail colors.
(it might be an issue in the code-block:: pytest style)
Also, we might want to use different characters for passing vs failing subtests to support non-color terminal outputs
Thanks for the report, indeed the u colors are not all green when running in CLI:
(it might be an issue in the code-block:: pytest style)
That's correct, the highlighter only sees u and I don't think it can tell whether it's a success or failure.
Also, we might want to use different characters for passing vs failing subtests to support non-color terminal outputs
cc @nicoddemus on this suggestion.
Thanks, this helps clarify the issue. The main problem is that the documentation shows all u characters in green even when some subtests fail. The syntax highlighter can’t distinguish between passed and failed subtests, right? I agree with the suggestion using different characters for pass/fail instead of relying only on color would make the output clearer. I’m interested in working on this issue. I’ll look into the documentation rendering and see where the incorrect highlighting is happening. Is it okay if I take this?