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

gh-106584: Fix exit code for unittest in Python 3.12 #106588

Merged

Conversation

EliseevEgor
Copy link
Contributor

@EliseevEgor EliseevEgor commented Jul 10, 2023

Increase the number of running tests only if a test hasn't been skipped.

@bedevere-bot
Copy link

Most changes to Python require a NEWS entry.

Please add it using the blurb_it web app or the blurb command-line tool.

@cpython-cla-bot
Copy link

cpython-cla-bot bot commented Jul 10, 2023

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-bot
Copy link

Most changes to Python require a NEWS entry.

Please add it using the blurb_it web app or the blurb command-line tool.

@EliseevEgor EliseevEgor force-pushed the egoreliseev/Issue-106584_move_start_test branch from 2b0b119 to 9efdf58 Compare July 10, 2023 12:48
@bedevere-bot
Copy link

Most changes to Python require a NEWS entry.

Please add it using the blurb_it web app or the blurb command-line tool.

Increase the number of running tests only if it hasn't been skipped.
@EliseevEgor EliseevEgor force-pushed the egoreliseev/Issue-106584_move_start_test branch from 9efdf58 to 6e1be71 Compare July 10, 2023 12:51
@bedevere-bot
Copy link

Most changes to Python require a NEWS entry.

Please add it using the blurb_it web app or the blurb command-line tool.

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

LGTM, but please add a NEWS entry!

Lib/unittest/case.py Outdated Show resolved Hide resolved
@sunmy2019 sunmy2019 added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 11, 2023
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @sunmy2019 for commit 9779a2b 🤖

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 11, 2023
Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

No need to specify the version info in the NEWS.

@sunmy2019 sunmy2019 added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 11, 2023
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @sunmy2019 for commit 6313c98 🤖

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 11, 2023
@sunmy2019
Copy link
Member

We got some failed tests. Most are unrelated, but we might need to rule them out.

@hauntsaninja hauntsaninja added the needs backport to 3.12 bug and security fixes label Sep 1, 2023
@ambv ambv merged commit 8fc0713 into python:main Sep 22, 2023
23 checks passed
@miss-islington
Copy link
Contributor

Thanks @EliseevEgor for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 22, 2023
…106588)

(cherry picked from commit 8fc0713)

Co-authored-by: EliseevEgor <egor.eliseev@jetbrains.com>
Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
@bedevere-app
Copy link

bedevere-app bot commented Sep 22, 2023

GH-109725 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Sep 22, 2023
csm10495 pushed a commit to csm10495/cpython that referenced this pull request Sep 28, 2023
…6588)

Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Yhg1s pushed a commit that referenced this pull request Oct 2, 2023
… (#109725)

gh-106584: Fix exit code for unittest in Python 3.12 (GH-106588)
(cherry picked from commit 8fc0713)

Co-authored-by: EliseevEgor <egor.eliseev@jetbrains.com>
Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
felixxm added a commit to felixxm/django that referenced this pull request Oct 15, 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 felixxm/django that referenced this pull request 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 pull request 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 pull request 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 pull request 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
@exarkun
Copy link
Contributor

exarkun commented Dec 18, 2023

It doesn't seem like this ought to have been backported. It includes an incompatible change in the long-established protocol between a test runner and a test results object. One consequence is that it has broken trial's multiprocess test runner (twisted/twisted#12052).

mtreinish added a commit to mtreinish/testtools that referenced this pull request Jan 5, 2024
In Python 3.12.1 python/cpython#106588 was backported which changed the
execution behavior of the unittest runner. After python/cpython#106588
startTest() is no longer being called if a test is skipped. This causes
knock-on effects in testtools because the test result subclasses were
assuming that startTest() was always called when stopTest() was called.
To handle this change in behavior when running with Python 3.12.1 this
commit adds a check to only deal with tags if they exist (when
startTest() is run).
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.

None yet

8 participants