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-113661: unittest runner: Don't exit 5 if tests were skipped by stefanor · Pull Request #113856 · python/cpython

Conversation

@stefanor

@stefanor stefanor commented Jan 9, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

The intention of exiting 5 was to detect issues where the test suite wasn't discovered at all. If we skipped tests, it was correctly discovered.

Follow on to (and resolving a bug in) GH-62432.

  • Issue: 3.12 starts to return an error when all tests in a test file are skipped #113661

Sorry, something went wrong.

Uh oh!

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

All reactions
@bedevere-app bedevere-app Bot added the awaiting review label Jan 9, 2024
@bedevere-app bedevere-app Bot mentioned this pull request Jan 9, 2024
3.12 starts to return an error when all tests in a test file are skipped #113661
Closed
@stefanor
pythonGH-113661: unittest runner: Don't exit 5 if tests were skipped
69454c1
The intention of exiting 5 was to detect issues where the test suite
wasn't discovered at all. If we skipped tests, it was correctly
discovered.
@stefanor
stefanor force-pushed the exit-0-skipped-tests branch from 495c196 to 69454c1 Compare January 9, 2024 13:13
@stefanor

stefanor commented Jan 9, 2024

Copy link
Copy Markdown
Contributor Author

@gpshead, @vstinner: Filed this PR to fix the regression.

All reactions

Sorry, something went wrong.

Uh oh!

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

gpshead
gpshead approved these changes Jan 9, 2024
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Jan 9, 2024
@gpshead
Merge branch 'main' into exit-0-skipped-tests
5765291
@gpshead gpshead added needs backport to 3.12 only security fixes type-bug An unexpected behavior, bug, or error labels Jan 9, 2024
@gpshead
gpshead enabled auto-merge (squash) January 9, 2024 19:28
@gpshead
gpshead merged commit 3a9096c into python:main Jan 9, 2024
@miss-islington-app

miss-islington-app Bot commented Jan 9, 2024

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-app bedevere-app Bot removed the awaiting merge label Jan 9, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 9, 2024
@stefanor @miss-islington
pythonGH-113661: unittest runner: Don't exit 5 if tests were skipped (p…
767e204
…ythonGH-113856)

The intention of exiting 5 was to detect issues where the test suite
wasn't discovered at all. If we skipped tests, it was correctly
discovered.
(cherry picked from commit 3a9096c)

Co-authored-by: Stefano Rivera <[email protected]>
@bedevere-app

bedevere-app Bot commented Jan 9, 2024

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.12 only security fixes label Jan 9, 2024
@stefanor
stefanor deleted the exit-0-skipped-tests branch January 9, 2024 19:59
gpshead pushed a commit that referenced this pull request Jan 9, 2024
@miss-islington @stefanor
[3.12] GH-113661: unittest runner: Don't exit 5 if tests were skipped (…
159e3db
…GH-113856) (#113875)

GH-113661: unittest runner: Don't exit 5 if tests were skipped (GH-113856)

The intention of exiting 5 was to detect issues where the test suite
wasn't discovered at all. If we skipped tests, it was correctly
discovered.
(cherry picked from commit 3a9096c)

Co-authored-by: Stefano Rivera <[email protected]>
kulikjak pushed a commit to kulikjak/cpython that referenced this pull request Jan 22, 2024
@stefanor @kulikjak
pythonGH-113661: unittest runner: Don't exit 5 if tests were skipped (p…
97d87a5
…ython#113856)

The intention of exiting 5 was to detect issues where the test suite
wasn't discovered at all. If we skipped tests, it was correctly
discovered.
kraj pushed a commit to YoeDistro/meta-openembedded that referenced this pull request Jan 23, 2024
@wangmingyu84 @kraj
python3-absl: upgrade 2.0.0 -> 2.1.0
c38490b
Changelog:
=========
-Added absl.flags.override_value function to provide FlagHolder with a construct
 to modify values.
-Added a new method absltest.TestCase.assertDataclassEqual that tests equality
 of dataclass.dataclass objects with better error messages when the assert fails.
-absl.flags.argparse_flags.ArgumentParser now correctly inherits an empty
 instance of FlagValues to ensure that absl flags, such as --flagfile, --undefok
 are supported.
-Do not exit 5 if tests were skipped on Python 3.12. This follows the CPython
 change in python/cpython#113856.
-The flag foo no longer retains the value bar after FLAGS.foo = bar fails due to
 a validation error.
-Fixed an issue caused by this Python 3.12.1 change where the test reporter
 crashes when all tests are skipped.

Signed-off-by: Wang Mingyu <[email protected]>
Signed-off-by: Khem Raj <[email protected]>
kraj pushed a commit to YoeDistro/meta-openembedded that referenced this pull request Jan 23, 2024
@wangmingyu84 @kraj
python3-absl: upgrade 2.0.0 -> 2.1.0
70d87c5
Changelog:
=========
-Added absl.flags.override_value function to provide FlagHolder with a construct
 to modify values.
-Added a new method absltest.TestCase.assertDataclassEqual that tests equality
 of dataclass.dataclass objects with better error messages when the assert fails.
-absl.flags.argparse_flags.ArgumentParser now correctly inherits an empty
 instance of FlagValues to ensure that absl flags, such as --flagfile, --undefok
 are supported.
-Do not exit 5 if tests were skipped on Python 3.12. This follows the CPython
 change in python/cpython#113856.
-The flag foo no longer retains the value bar after FLAGS.foo = bar fails due to
 a validation error.
-Fixed an issue caused by this Python 3.12.1 change where the test reporter
 crashes when all tests are skipped.

Signed-off-by: Wang Mingyu <[email protected]>
Signed-off-by: Khem Raj <[email protected]>
kraj pushed a commit to YoeDistro/meta-openembedded that referenced this pull request Jan 23, 2024
@wangmingyu84 @kraj
python3-absl: upgrade 2.0.0 -> 2.1.0
0007269
Changelog:
=========
-Added absl.flags.override_value function to provide FlagHolder with a construct
 to modify values.
-Added a new method absltest.TestCase.assertDataclassEqual that tests equality
 of dataclass.dataclass objects with better error messages when the assert fails.
-absl.flags.argparse_flags.ArgumentParser now correctly inherits an empty
 instance of FlagValues to ensure that absl flags, such as --flagfile, --undefok
 are supported.
-Do not exit 5 if tests were skipped on Python 3.12. This follows the CPython
 change in python/cpython#113856.
-The flag foo no longer retains the value bar after FLAGS.foo = bar fails due to
 a validation error.
-Fixed an issue caused by this Python 3.12.1 change where the test reporter
 crashes when all tests are skipped.

Signed-off-by: Wang Mingyu <[email protected]>
Signed-off-by: Khem Raj <[email protected]>
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
@stefanor @aisk
pythonGH-113661: unittest runner: Don't exit 5 if tests were skipped (p…
9a610a4
…ython#113856)

The intention of exiting 5 was to detect issues where the test suite
wasn't discovered at all. If we skipped tests, it was correctly
discovered.
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Feb 11, 2024
adam
py-absl-py: updated to 2.1.0
037a65c
2.1.0 (2024-01-16)

Added

(flags) Added absl.flags.override_value function to provide FlagHolder with a construct to modify values. The new interface parallels absl.flags.FlagValues.__setattr__ but checks that the provided value conforms to the flag's expected type.
(testing) Added a new method absltest.TestCase.assertDataclassEqual that tests equality of dataclass.dataclass objects with better error messages when the assert fails.
Changed

(flags) absl.flags.argparse_flags.ArgumentParser now correctly inherits an empty instance of FlagValues to ensure that absl flags, such as --flagfile, --undefok are supported.
(testing) Do not exit 5 if tests were skipped on Python 3.12. This follows the CPython change in python/cpython#113856.
Fixed

(flags) The flag foo no longer retains the value bar after FLAGS.foo = bar fails due to a validation error.
(testing) Fixed an issue caused by this Python 3.12.1 change where the test reporter crashes when all tests are skipped.


2.0.0 (2023-09-19)

Changed

absl-py no longer supports Python 3.6. It has reached end-of-life for more than a year now.
Support Python 3.12.
(logging) logging.exception can now take exc_info as argument, with default value True. Prior to this change setting exc_info would raise KeyError, this change fixes this behaviour.
(testing) For Python 3.11+, the calls to absltest.TestCase.enter_context are forwarded to unittest.TestCase.enterContext (when called via instance) or unittest.TestCase.enterClassContext (when called via class) now. As a result, on Python 3.11+, the private _cls_exit_stack attribute is not defined on absltest.TestCase and _exit_stack attribute is not defined on its instances.
(testing) absltest.TestCase.assertSameStructure() now uses the test case's equality functions (registered with TestCase.addTypeEqualityFunc()) for comparing leaves of the structure.
(testing) abslTest.TestCase.fail() now names its arguments (self, msg=None, user_msg=None), and not (self, msg=None, prefix=None), better reflecting the behavior and usage of the two message arguments.
DEFINE_enum, DEFINE_multi_enum, and EnumParser now raise errors when enum_values is provided as a single string value. Additionally, EnumParser.enum_values is now stored as a list copy of the provided enum_values parameter.
(testing) Updated paramaterized.CoopTestCase() to use Python 3 metaclass idioms. Most uses of this function continued working during the Python 3 migration still worked because a Python 2 compatibility __metaclass__ variables also existed. Now pure Python 3 base classes without backwards compatibility will work as intended.
(testing) absltest.TestCase.assertSequenceStartsWith now explicitly fail when passed a Mapping or Set object as the whole argument.
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
@stefanor @Glyphack
pythonGH-113661: unittest runner: Don't exit 5 if tests were skipped (p…
87c4e9c
…ython#113856)

The intention of exiting 5 was to detect issues where the test suite
wasn't discovered at all. If we skipped tests, it was correctly
discovered.
msk pushed a commit to msk/pkgsrc that referenced this pull request May 11, 2026
adam
py-absl-py: updated to 2.1.0
f912a03
2.1.0 (2024-01-16)

Added

(flags) Added absl.flags.override_value function to provide FlagHolder with a construct to modify values. The new interface parallels absl.flags.FlagValues.__setattr__ but checks that the provided value conforms to the flag's expected type.
(testing) Added a new method absltest.TestCase.assertDataclassEqual that tests equality of dataclass.dataclass objects with better error messages when the assert fails.
Changed

(flags) absl.flags.argparse_flags.ArgumentParser now correctly inherits an empty instance of FlagValues to ensure that absl flags, such as --flagfile, --undefok are supported.
(testing) Do not exit 5 if tests were skipped on Python 3.12. This follows the CPython change in python/cpython#113856.
Fixed

(flags) The flag foo no longer retains the value bar after FLAGS.foo = bar fails due to a validation error.
(testing) Fixed an issue caused by this Python 3.12.1 change where the test reporter crashes when all tests are skipped.


2.0.0 (2023-09-19)

Changed

absl-py no longer supports Python 3.6. It has reached end-of-life for more than a year now.
Support Python 3.12.
(logging) logging.exception can now take exc_info as argument, with default value True. Prior to this change setting exc_info would raise KeyError, this change fixes this behaviour.
(testing) For Python 3.11+, the calls to absltest.TestCase.enter_context are forwarded to unittest.TestCase.enterContext (when called via instance) or unittest.TestCase.enterClassContext (when called via class) now. As a result, on Python 3.11+, the private _cls_exit_stack attribute is not defined on absltest.TestCase and _exit_stack attribute is not defined on its instances.
(testing) absltest.TestCase.assertSameStructure() now uses the test case's equality functions (registered with TestCase.addTypeEqualityFunc()) for comparing leaves of the structure.
(testing) abslTest.TestCase.fail() now names its arguments (self, msg=None, user_msg=None), and not (self, msg=None, prefix=None), better reflecting the behavior and usage of the two message arguments.
DEFINE_enum, DEFINE_multi_enum, and EnumParser now raise errors when enum_values is provided as a single string value. Additionally, EnumParser.enum_values is now stored as a list copy of the provided enum_values parameter.
(testing) Updated paramaterized.CoopTestCase() to use Python 3 metaclass idioms. Most uses of this function continued working during the Python 3 migration still worked because a Python 2 compatibility __metaclass__ variables also existed. Now pure Python 3 base classes without backwards compatibility will work as intended.
(testing) absltest.TestCase.assertSequenceStartsWith now explicitly fail when passed a Mapping or Set object as the whole argument.
jperkin pushed a commit to TritonDataCenter/pkgsrc that referenced this pull request May 14, 2026
adam
py-absl-py: updated to 2.1.0
29b632e
2.1.0 (2024-01-16)

Added

(flags) Added absl.flags.override_value function to provide FlagHolder with a construct to modify values. The new interface parallels absl.flags.FlagValues.__setattr__ but checks that the provided value conforms to the flag's expected type.
(testing) Added a new method absltest.TestCase.assertDataclassEqual that tests equality of dataclass.dataclass objects with better error messages when the assert fails.
Changed

(flags) absl.flags.argparse_flags.ArgumentParser now correctly inherits an empty instance of FlagValues to ensure that absl flags, such as --flagfile, --undefok are supported.
(testing) Do not exit 5 if tests were skipped on Python 3.12. This follows the CPython change in python/cpython#113856.
Fixed

(flags) The flag foo no longer retains the value bar after FLAGS.foo = bar fails due to a validation error.
(testing) Fixed an issue caused by this Python 3.12.1 change where the test reporter crashes when all tests are skipped.


2.0.0 (2023-09-19)

Changed

absl-py no longer supports Python 3.6. It has reached end-of-life for more than a year now.
Support Python 3.12.
(logging) logging.exception can now take exc_info as argument, with default value True. Prior to this change setting exc_info would raise KeyError, this change fixes this behaviour.
(testing) For Python 3.11+, the calls to absltest.TestCase.enter_context are forwarded to unittest.TestCase.enterContext (when called via instance) or unittest.TestCase.enterClassContext (when called via class) now. As a result, on Python 3.11+, the private _cls_exit_stack attribute is not defined on absltest.TestCase and _exit_stack attribute is not defined on its instances.
(testing) absltest.TestCase.assertSameStructure() now uses the test case's equality functions (registered with TestCase.addTypeEqualityFunc()) for comparing leaves of the structure.
(testing) abslTest.TestCase.fail() now names its arguments (self, msg=None, user_msg=None), and not (self, msg=None, prefix=None), better reflecting the behavior and usage of the two message arguments.
DEFINE_enum, DEFINE_multi_enum, and EnumParser now raise errors when enum_values is provided as a single string value. Additionally, EnumParser.enum_values is now stored as a list copy of the provided enum_values parameter.
(testing) Updated paramaterized.CoopTestCase() to use Python 3 metaclass idioms. Most uses of this function continued working during the Python 3 migration still worked because a Python 2 compatibility __metaclass__ variables also existed. Now pure Python 3 base classes without backwards compatibility will work as intended.
(testing) absltest.TestCase.assertSequenceStartsWith now explicitly fail when passed a Mapping or Set object as the whole argument.
tsutsui pushed a commit to tsutsui/pkgsrc that referenced this pull request Oct 17, 2026
adam
py-absl-py: updated to 2.1.0
e7e3cab
2.1.0 (2024-01-16)

Added

(flags) Added absl.flags.override_value function to provide FlagHolder with a construct to modify values. The new interface parallels absl.flags.FlagValues.__setattr__ but checks that the provided value conforms to the flag's expected type.
(testing) Added a new method absltest.TestCase.assertDataclassEqual that tests equality of dataclass.dataclass objects with better error messages when the assert fails.
Changed

(flags) absl.flags.argparse_flags.ArgumentParser now correctly inherits an empty instance of FlagValues to ensure that absl flags, such as --flagfile, --undefok are supported.
(testing) Do not exit 5 if tests were skipped on Python 3.12. This follows the CPython change in python/cpython#113856.
Fixed

(flags) The flag foo no longer retains the value bar after FLAGS.foo = bar fails due to a validation error.
(testing) Fixed an issue caused by this Python 3.12.1 change where the test reporter crashes when all tests are skipped.


2.0.0 (2023-09-19)

Changed

absl-py no longer supports Python 3.6. It has reached end-of-life for more than a year now.
Support Python 3.12.
(logging) logging.exception can now take exc_info as argument, with default value True. Prior to this change setting exc_info would raise KeyError, this change fixes this behaviour.
(testing) For Python 3.11+, the calls to absltest.TestCase.enter_context are forwarded to unittest.TestCase.enterContext (when called via instance) or unittest.TestCase.enterClassContext (when called via class) now. As a result, on Python 3.11+, the private _cls_exit_stack attribute is not defined on absltest.TestCase and _exit_stack attribute is not defined on its instances.
(testing) absltest.TestCase.assertSameStructure() now uses the test case's equality functions (registered with TestCase.addTypeEqualityFunc()) for comparing leaves of the structure.
(testing) abslTest.TestCase.fail() now names its arguments (self, msg=None, user_msg=None), and not (self, msg=None, prefix=None), better reflecting the behavior and usage of the two message arguments.
DEFINE_enum, DEFINE_multi_enum, and EnumParser now raise errors when enum_values is provided as a single string value. Additionally, EnumParser.enum_values is now stored as a list copy of the provided enum_values parameter.
(testing) Updated paramaterized.CoopTestCase() to use Python 3 metaclass idioms. Most uses of this function continued working during the Python 3 migration still worked because a Python 2 compatibility __metaclass__ variables also existed. Now pure Python 3 base classes without backwards compatibility will work as intended.
(testing) absltest.TestCase.assertSequenceStartsWith now explicitly fail when passed a Mapping or Set object as the whole argument.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@gpshead gpshead gpshead approved these changes

Uh oh!

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

Assignees

No one assigned

Labels

type-bug An unexpected behavior, bug, or error

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.

2 participants

@stefanor @gpshead
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.