Skip to content

unittest.TestResult.testsRun no longer counts skipped tests. #110890

Description

@felixxm

Bug report

Bug description:

unittest.TestResult.testsRun no 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

Activity

  1. AlexWaygood commented on Oct 15, 2023

    @AlexWaygood
  2. felixxm commented on Oct 15, 2023

    @felixxm
    Author
  3. changed the title [-]TestResult.testsRun no longer counts skipped tests.[/-] [+]unittest.TestResult.testsRun no longer counts skipped tests.[/+] on Oct 15, 2023
  4. added
    stdlibStandard Library Python modules in the Lib/ directory
    3.13only security fixes
    on Oct 15, 2023
  5. terryjreedy commented on Oct 15, 2023

    @terryjreedy
    Member

    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".

  6. felixxm commented on Oct 15, 2023

    @felixxm
    ContributorAuthor

    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 🌟

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13only security fixesstdlibStandard Library Python modules in the Lib/ directory

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions