GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-106584: Fix exit code for unittest in Python 3.12 by EliseevEgor · Pull Request #106588 · python/cpython

Conversation

@EliseevEgor

@EliseevEgor EliseevEgor commented Jul 10, 2023 •
edited by terryjreedy
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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

  • Issue: Return the correct exit code if all tests have been skipped in unittest #106584

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-bot bedevere-bot added the awaiting review label Jul 10, 2023
@bedevere-bot

bedevere-bot commented Jul 10, 2023

Copy link
Copy Markdown

Most changes to Python require a NEWS entry.

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot mentioned this pull request Jul 10, 2023
Return the correct exit code if all tests have been skipped in unittest #106584
Closed
@ghost

ghost commented Jul 10, 2023 •
edited by ghost
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.
CLA signed

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot

bedevere-bot commented Jul 10, 2023

Copy link
Copy Markdown

Most changes to Python require a NEWS entry.

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

bedevere-bot commented Jul 10, 2023

Copy link
Copy Markdown

Most changes to Python require a NEWS entry.

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@EliseevEgor
pythonGH-106584: Fix exit code for unittest in Python 3.12
6e1be71
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

bedevere-bot commented Jul 10, 2023

Copy link
Copy Markdown

Most changes to Python require a NEWS entry.

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

sobolevn
sobolevn approved these changes Jul 11, 2023
View reviewed changes

@sobolevn sobolevn left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this 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!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-bot bedevere-bot added awaiting core review and removed awaiting review labels Jul 11, 2023
@blurb-it
📜🤖 Added by blurb_it.
ee3af81
sunmy2019
sunmy2019 reviewed Jul 11, 2023
View reviewed changes
Comment thread Misc/NEWS.d/next/Library/2023-07-11-08-56-40.gh-issue-106584.g-SBtC.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@sunmy2019
Update Misc/NEWS.d/next/Library/2023-07-11-08-56-40.gh-issue-106584.g…
9779a2b
…-SBtC.rst
sunmy2019
sunmy2019 reviewed Jul 11, 2023
View reviewed changes
Comment thread Lib/unittest/case.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

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

bedevere-bot commented Jul 11, 2023

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 11, 2023
@EliseevEgor @sunmy2019
pythonGH-106584: Apply comment suggestion
43248a9
Co-authored-by: sunmy2019 <[email protected]>
sobolevn
sobolevn reviewed Jul 11, 2023
View reviewed changes

@sobolevn sobolevn left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this 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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Misc/NEWS.d/next/Library/2023-07-11-08-56-40.gh-issue-106584.g-SBtC.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

EliseevEgor and others added 3 commits July 11, 2023 14:04
@EliseevEgor @sobolevn
pythonGH-106584: Remove the version info in the NEWS
901cf01
Co-authored-by: Nikita Sobolev <[email protected]>
@EliseevEgor
pythonGH-106584: Remove empty line in the NEWS
1ab5cfa
@EliseevEgor
pythonGH-106584: Check buffers before seek
6313c98
@sunmy2019 sunmy2019 added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 11, 2023
@bedevere-bot

bedevere-bot commented Jul 11, 2023

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

sunmy2019 commented Jul 13, 2023

Copy link
Copy Markdown
Member

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sunmy2019
Merge branch 'main' into egoreliseev/Issue-106584_move_start_test
046ae78
@terryjreedy terryjreedy mentioned this pull request Oct 15, 2023
unittest.TestResult.testsRun no longer counts skipped tests. #110890
Closed
@felixxm felixxm mentioned this pull request Oct 15, 2023
Refs #34900, Refs #34118 -- Updated assertion in test_skip_class_unless_db_feature() test on Python 3.12.1+. django/django#17367
Merged
felixxm added a commit to felixxm/django that referenced this pull request Oct 16, 2023
@felixxm
Refs #34900, Refs #34118 -- Updated assertion in test_skip_class_unle…
ff855ed
…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
@felixxm
Refs #34900, Refs #34118 -- Updated assertion in test_skip_class_unle…
20b7aac
…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
@felixxm
[5.0.x] Refs #34900, Refs #34118 -- Updated assertion in test_skip_cl…
448510a
…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
@felixxm
[4.2.x] Refs #34900, Refs #34118 -- Updated assertion in test_skip_cl…
a576ef9
…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

exarkun commented Dec 18, 2023

Copy link
Copy Markdown
Contributor

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 and yilei reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mtreinish added a commit to mtreinish/testtools that referenced this pull request Jan 5, 2024
@mtreinish
Handle breaking api change in Python 3.12.1
e95d993
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).
@mtreinish mtreinish mentioned this pull request Jan 5, 2024
Handle breaking api change in Python 3.12.1 testing-cabal/testtools#371
Merged
@yilei

yilei commented Jan 11, 2024

Copy link
Copy Markdown
Contributor

FYI-- This also broke absl.testing where it tracks test runtime with startTest and stopTest: https://github.com/abseil/abseil-py/blob/2af184bfcdaa6156a5a098923a9561bc4b7d988c/absl/testing/xml_reporter.py#L352-L365

We should be able to workaround it, but just wanted to point this out. It seems strange for stopTest to be called without a startTest.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

copybara-service Bot pushed a commit to abseil/abseil-py that referenced this pull request Jan 11, 2024
@yilei @copybara-github
Fix absl.testing.xml_reporter for Python 3.12.1 when all tests are sk…
51a69e4
…ipped.

`startTest` may not be called in this case, after the change in python/cpython#106588.

PiperOrigin-RevId: 597675639
@copybara-service copybara-service Bot mentioned this pull request Jan 11, 2024
Fix absl.testing.xml_reporter for Python 3.12.1 when all tests are skipped. abseil/abseil-py#271
Merged
copybara-service Bot pushed a commit to abseil/abseil-py that referenced this pull request Jan 12, 2024
@yilei @copybara-github
Fix absl.testing.xml_reporter for Python 3.12.1 when all tests are sk…
c54e6da
…ipped.

`startTest` may not be called in this case, after the change in python/cpython#106588.

PiperOrigin-RevId: 597675639
copybara-service Bot pushed a commit to abseil/abseil-py that referenced this pull request Jan 12, 2024
@yilei @copybara-github
Fix absl.testing.xml_reporter for Python 3.12.1 when all tests are sk…
083f75d
…ipped.

`startTest` may not be called in this case, after the change in python/cpython#106588.

PiperOrigin-RevId: 597675639
copybara-service Bot pushed a commit to abseil/abseil-py that referenced this pull request Jan 12, 2024
@yilei @copybara-github
Fix absl.testing.xml_reporter for Python 3.12.1 when all tests are sk…
ac233e8
…ipped.

`startTest` may not be called in this case, after the change in python/cpython#106588.

PiperOrigin-RevId: 597675639
copybara-service Bot pushed a commit to abseil/abseil-py that referenced this pull request Jan 12, 2024
@yilei @copybara-github
Fix absl.testing.xml_reporter for Python 3.12.1 when all tests are sk…
93f0b2e
…ipped.

`startTest` may not be called in this case, after the change in python/cpython#106588.

PiperOrigin-RevId: 597675639
copybara-service Bot pushed a commit to abseil/abseil-py that referenced this pull request Jan 12, 2024
@yilei @copybara-github
Fix absl.testing.xml_reporter for Python 3.12.1 when all tests are sk…
1e13a8c
…ipped.

`startTest` may not be called in this case, after the change in python/cpython#106588.

PiperOrigin-RevId: 597840713
stephenfin pushed a commit to testing-cabal/testtools that referenced this pull request Jan 16, 2024
@mtreinish @stephenfin
Handle breaking api change in Python 3.12.1
a481b55
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).
wshanks added a commit to conda-forge/qiskit-aer-feedstock that referenced this pull request Jan 19, 2024
@wshanks
Add Python 3.12 builds (#31)
dedee0d
* Add Python 3.12 builds

The migrator seems confused by another package from a split feedstock
that also produces non-Python packages that qiskit-aer depends on
not having Python 3.12 builds yet, so this is a manual migration.

Explicitly exclude TestNoiseTransformer tests because they require cvxpy.
Previously they were skipped by unittest when cvxpy was not installed but
test skipping was broken by Python 3.12.1 (see
testing-cabal/testtools#371 and
python/cpython#106588), so we had to explicitly
skip the tests with the test runner.
@wshanks wshanks mentioned this pull request Jan 19, 2024
Add Python 3.12 builds conda-forge/qiskit-aer-feedstock#31
Merged
4 of 5 tasks
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Jan 23, 2024
@serhiy-storchaka
Revert "pythongh-106584: Fix exit code for unittest in Python 3.12 (p…
15d1968
…ython#106588)"

This reverts commit 8fc0713.
serhiy-storchaka added a commit that referenced this pull request Feb 4, 2024
@serhiy-storchaka
gh-113267: Revert "gh-106584: Fix exit code for unittest in Python 3.…
ecabff9
…12 (#106588)" (GH-114470)

This reverts commit 8fc0713.
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 4, 2024
@serhiy-storchaka @miss-islington
pythongh-113267: Revert "pythongh-106584: Fix exit code for unittest …
b79c37f
…in Python 3.12 (pythonGH-106588)" (pythonGH-114470)

This reverts commit 8fc0713.
(cherry picked from commit ecabff9)

Co-authored-by: Serhiy Storchaka <[email protected]>
serhiy-storchaka added a commit that referenced this pull request Feb 4, 2024
@miss-islington @serhiy-storchaka
[3.12] gh-113267: Revert "gh-106584: Fix exit code for unittest in Py…
0a73763
…thon 3.12 (GH-106588)" (GH-114470) (GH-114994)

This reverts commit 8fc0713.
(cherry picked from commit ecabff9)

Co-authored-by: Serhiy Storchaka <[email protected]>
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
@serhiy-storchaka @aisk
pythongh-113267: Revert "pythongh-106584: Fix exit code for unittest …
9d44784
…in Python 3.12 (python#106588)" (pythonGH-114470)

This reverts commit 8fc0713.
fsc-eriker pushed a commit to fsc-eriker/cpython that referenced this pull request Feb 14, 2024
@serhiy-storchaka @fsc-eriker
pythongh-113267: Revert "pythongh-106584: Fix exit code for unittest …
39378cc
…in Python 3.12 (python#106588)" (pythonGH-114470)

This reverts commit 8fc0713.
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
@EliseevEgor @sunmy2019
@sobolevn @Glyphack
pythongh-106584: Fix exit code for unittest in Python 3.12 (python#10…
4eaba4a
…6588)

Co-authored-by: sunmy2019 <[email protected]>
Co-authored-by: Nikita Sobolev <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@sobolevn sobolevn sobolevn approved these changes
@sunmy2019 sunmy2019 sunmy2019 left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

9 participants

@EliseevEgor @bedevere-bot @sunmy2019 @miss-islington @exarkun @yilei @sobolevn @ambv @hauntsaninja
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.