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

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

Closed
felixxm opened this issue Oct 15, 2023 · 4 comments
Closed

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

felixxm opened this issue Oct 15, 2023 · 4 comments
Labels
3.13 bugs and security fixes stdlib Python modules in the Lib dir

Comments

@felixxm
Copy link
Contributor

felixxm commented Oct 15, 2023

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

@felixxm felixxm added the type-bug An unexpected behavior, bug, or error label Oct 15, 2023
@AlexWaygood

This comment was marked as resolved.

@felixxm

This comment was marked as resolved.

@AlexWaygood AlexWaygood changed the title TestResult.testsRun no longer counts skipped tests. unittest.TestResult.testsRun no longer counts skipped tests. Oct 15, 2023
@AlexWaygood AlexWaygood added stdlib Python modules in the Lib dir 3.13 bugs and security fixes labels Oct 15, 2023
@terryjreedy terryjreedy removed the type-bug An unexpected behavior, bug, or error label Oct 15, 2023
@terryjreedy
Copy link
Member

terryjreedy commented 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 increments testsRun, is moved below the skip return with comment "# Increase the number of tests only if it hasn't been skipped".

@terryjreedy terryjreedy closed this as not planned Won't fix, can't repro, duplicate, stale Oct 15, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in Unittest issues Oct 15, 2023
@felixxm
Copy link
Contributor Author

felixxm commented 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 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 🌟

felixxm added a commit to felixxm/django that referenced this issue Oct 16, 2023
…ss_db_feature() test on Python 3.12.1+.

Python 3.12.1+ no longer includes skipped tests in the number of
running tests. Check out:

python/cpython#110890 (comment)
python/cpython#106588
felixxm added a commit to django/django that referenced this issue Oct 16, 2023
…ss_db_feature() test on Python 3.12.1+.

Python 3.12.1+ no longer includes skipped tests in the number of
running tests. Check out:

python/cpython#110890 (comment)
python/cpython#106588
felixxm added a commit to django/django that referenced this issue Oct 16, 2023
…ass_unless_db_feature() test on Python 3.12.1+.

Python 3.12.1+ no longer includes skipped tests in the number of
running tests. Check out:

python/cpython#110890 (comment)
python/cpython#106588
Backport of 20b7aac from main
felixxm added a commit to django/django that referenced this issue Oct 16, 2023
…ass_unless_db_feature() test on Python 3.12.1+.

Python 3.12.1+ no longer includes skipped tests in the number of
running tests. Check out:

python/cpython#110890 (comment)
python/cpython#106588
Backport of 20b7aac from main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.13 bugs and security fixes stdlib Python modules in the Lib dir
Projects
Status: Done
Development

No branches or pull requests

3 participants