Repository navigation
unittest.TestResult.testsRun no longer counts skipped tests. #110890
Description
Activity
- addedtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
on Oct 15, 2023 felixxm commented
on Oct 15, 2023 on Oct 15, 2023 · Hidden as resolvedAuthorshow commentMore actions- changed the title
[-]TestResult.testsRun no longer counts skipped tests.[/-][+]unittest.TestResult.testsRun no longer counts skipped tests.[/+]on Oct 15, 2023 - addedstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory3.13only security fixesonly security fixes
on Oct 15, 2023 - removedtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
on Oct 15, 2023 Intentional change viewed as a bugfix. In the 3.13 changelog changelog:
gh-106584: Fix exit code for unittest if all tests are skipped.
The corresponding PR 106588 starts "Increase the number of running tests only if a test hasn't been skipped." This was merged into 3.13 a week before 3.12.0 was released and the backport was deferred until after that release to appear in 3.12.1. In the diff, the call to result.startTest, which incrementstestsRun, is moved below the skip return with comment "# Increase the number of tests only if it hasn't been skipped".Intentional change viewed as a bugfix. In the 3.13 changelog changelog: gh-106584: Fix exit code for unittest if all tests are skipped. The corresponding PR 106588 starts "Increase the number of running tests only if a test hasn't been skipped." This was merged into 3.13 a week before 3.12.0 was released and the backport was deferred until after that release to appear in 3.12.1. In the diff, the call to result.startTest, which increments
testsRun, is moved below the skip return with comment "# Increase the number of tests only if it hasn't been skipped".@terryjreedy Many thanks for the detailed explanation 🌟
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsDone
Bug report
Bug description:
unittest.TestResult.testsRunno longer counts skipped tests in Python 3.13.0a1. I couldn't not find anything in the release notes, so maybe it's not an intended change 🤔 If it was changed on purpose I can adjust our test. Thanks!CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux