Skip to content

Conversation

@emilymamcarz
Copy link

Hello,

This PR resolves #13902.

Description

This PR corrects the subtests documentation example, which currently uses .. code-block:: pytest and displays all u characters in green. This is misleading because the real test output includes both passing and failing subtests, and pytest's syntax highlighter cannot distinguish between them. As a result, the documentation incorrectly implies that all subtests passed.

Solution

Replaces .. code-block:: pytest with .. code-block:: console to disable pytest-specific highlighting. This updates the subtest output example to show a realistic mixture of subtest results (e.g., u u u u uF) without relying on color and ensures the documentation reflects actual pytest output, including multiple subtest results and the final test failure due to failed subtests.

Information

Head-fork: emilymamcarz/pytest
compare: issue13902

base-fork: pytest-dev/pytest
base: main

Thanks,
Emily

Copy link
Member

@RonnyPfannschmidt RonnyPfannschmidt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for trying to start this - but i think its critical to fix the right project - the pgyments linter needs a fix, the output examples need to stay exactly how they where

$ pytest -q test_subtest.py
uuuuuF [100%]
u u u u uF [100%]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the next doc regen would undo this change
additionally the code block should lint as "pytest" theres a extra linter in pygments for that

the pygments linter may need updates

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the clarification. That makes sense.

I’ll revert the documentation changes and move the fix to the correct location. I’ll investigate the Pygments pytest lexer and open an issue/PR there so that the highlighting is corrected at the source. Once Pygments updates the lexer, pytest’s documentation can regenerate with the correct output.

Thanks for the guidance, I’ll follow up with the Pygments-side fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Documentation shows incorrect pytest output color for subtests

2 participants