Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: revisit folding skipped tests in summary #9876

Closed
nicoddemus opened this issue Apr 21, 2022 · 2 comments · Fixed by #12567
Closed

Proposal: revisit folding skipped tests in summary #9876

nicoddemus opened this issue Apr 21, 2022 · 2 comments · Fixed by #12567
Labels
topic: reporting related to terminal output and user-facing messages and errors type: proposal proposal for a new feature, often to gather opinions or design the API around the new feature

Comments

@nicoddemus
Copy link
Member

Currently we "fold" skipped tests in the summary:

===================================== short test summary info =====================================
SKIPPED [1] .tmp\test_summary_1.py:20: not available on this platform
SKIPPED [1] .tmp\test_summary_1.py:35: not available on this platform
XFAIL .tmp\test_summary_1.py::test_mem_crash
  reason: quarantine due to crashes
XPASS .tmp\test_summary_1.py::test_mem_crash_new
FAILED .tmp\test_summary_1.py::TestSimple::test_name - NameError: name 'name' is not defined
FAILED .tmp\test_summary_1.py::test_boolean_ops - assert False is True
PASSED .tmp\test_summary_1.py::TestSimple::test_passes
PASSED .tmp\test_summary_1.py::TestSimple::test_passes1
PASSED .tmp\test_summary_1.py::test_passes_non_critical
================== 2 failed, 3 passed, 2 skipped, 1 xfailed, 1 xpassed in 0.09s ===================

They are the only entries which don't show the node id, showing the file name and line number instead, and also try to fold/accumulate the summaries which come from the same skip marker/reason.

I tracked it down to prokaktus@3795b08, which introduced the -r option.

I wonder if this inconsistency is still worth having? Personally I would prefer the SKIPPED message to look the same as XFAIL/XPASS, and show up as once for each skipped test, instead of having them folded.

I notice there's a comment in the current code too regarding markers:

pytest/src/_pytest/terminal.py

Lines 1319 to 1321 in 28e8c85

# Folding reports with global pytestmark variable.
# This is a workaround, because for now we cannot identify the scope of a skip marker
# TODO: Revisit after marks scope would be fixed.

Perhaps @RonnyPfannschmidt can remark on that comment.

@nicoddemus nicoddemus added type: proposal proposal for a new feature, often to gather opinions or design the API around the new feature topic: reporting related to terminal output and user-facing messages and errors labels Apr 21, 2022
@RonnyPfannschmidt
Copy link
Member

The folding was introduced for sensible reporting even when there are hundreds of skips for reasons

AFAIK those numbers tend to be hit with skips often enough to warrant it, i haven't observed similar usage for xfail /xpass which is used in very different use cases

Im explicitly in favour of the difference here

@eli-schwartz
Copy link

eli-schwartz commented Apr 28, 2023

Hmm, hundreds of skips due to parameterization I assume?

I think I would personally prefer the test class::function name on its own instead of a line number, as I'd assume that has to be just as foldable as the line number.

pbrezina added a commit to pbrezina/pytest that referenced this issue Jul 3, 2024
This controlls how the skipped tests are display in the short summary.

- yes (default): keeps the current behavior that folds the skipped tests
  together
- no: each skipped test is on its own line, display as any other status

Resolves: pytest-dev#9876
Signed-off-by: Pavel Březina <[email protected]>
pbrezina added a commit to pbrezina/pytest that referenced this issue Jul 4, 2024
This controlls how the skipped tests are display in the short summary.

- yes (default): keeps the current behavior that folds the skipped tests
  together
- no: each skipped test is on its own line, display as any other status

Resolves: pytest-dev#9876
Signed-off-by: Pavel Březina <[email protected]>
pbrezina added a commit to pbrezina/pytest that referenced this issue Jul 4, 2024
This controlls how the skipped tests are display in the short summary.

- yes (default): keeps the current behavior that folds the skipped tests
  together
- no: each skipped test is on its own line, display as any other status

Resolves: pytest-dev#9876
Signed-off-by: Pavel Březina <[email protected]>
pbrezina added a commit to pbrezina/pytest that referenced this issue Jul 4, 2024
This controlls how the skipped tests are display in the short summary.

- yes (default): keeps the current behavior that folds the skipped tests
  together
- no: each skipped test is on its own line, display as any other status

Resolves: pytest-dev#9876
Signed-off-by: Pavel Březina <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: reporting related to terminal output and user-facing messages and errors type: proposal proposal for a new feature, often to gather opinions or design the API around the new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants