Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-62432: unittest runner: Exit code 5 if no tests were run#102051

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
gpshead merged 13 commits intopython:mainfromstefanor:fail-zero-tests
Apr 27, 2023

Conversation

@stefanor
Copy link
Contributor

@stefanorstefanor commentedFeb 19, 2023
edited by bedevere-bot
Loading

As discussed inhttps://discuss.python.org/t/unittest-fail-if-zero-tests-were-discovered/21498/7

It is common for test runner misconfiguration to fail to find any tests,
this should be an error.

Fixes:#62432

@terryjreedyterryjreedy added type-featureA feature request or enhancement testsTests in the Lib/test dir labelsFeb 20, 2023
@terryjreedy
Copy link
Member

Tests/macOS is routinely failing; ignore currently.

This is a design bug fix, hence enhancement (feature change), as much as I would like to pretend otherwise.

@stefanorstefanor requested review fromhugovk and removed request forezio-melotti andgpsheadFebruary 20, 2023 11:51
@stefanor
Copy link
ContributorAuthor

@stefanor stefanor requested review fromhugovk and removed request forgpshead andezio-melotti

Urgh, that removal wasn't intentional, I just hit the re-request review button.

hugovk reacted with thumbs up emoji

@gpsheadgpshead self-assigned thisFeb 20, 2023
@stefanor
Copy link
ContributorAuthor

@gpshead: Ping? (it's been 2 months)

gpshead reacted with heart emoji

@gpsheadgpsheadenabled auto-merge (squash)April 27, 2023 01:04
@gpsheadgpshead merged commit76632b8 intopython:mainApr 27, 2023
@stefanorstefanor deleted the fail-zero-tests branchApril 27, 2023 11:49
@stefanor
Copy link
ContributorAuthor

Thank you!

@gpsheadgpshead added the 3.12only security fixes labelJun 13, 2023
copybara-servicebot pushed a commit to abseil/abseil-py that referenced this pull requestSep 14, 2023
- Either test filtering is used- Sharding is used and the shard index > 0, i.e. only the first shard will fail when no tests ran on Python 3.12+.Context: Python 3.12 unittest will now fail when no tests ran after the change frompython/cpython#102051. Since `absltest` is built on top of `unittest`, it will follow this behavior change in Python 3.12.However, when test filtering is used in `absltest`, often used via `bazel test --test_filter=<my_filter>`, the current user expectation is the `bazel test` command should NOT fail is at least one test ran. Since the test runner here has no visibility of the overall `bazel` invocation, we'll make the test not fail when test filtering is used. This is the existing behavior before Python 3.12.Also test absl-py on Python 3.12.PiperOrigin-RevId: 565190992
copybara-servicebot pushed a commit to abseil/abseil-py that referenced this pull requestSep 14, 2023
- Either test filtering is used- Sharding is used and the shard index > 0, i.e. only the first shard will fail when no tests ran on Python 3.12+.Context: Python 3.12 unittest will now fail when no tests ran after the change frompython/cpython#102051. Since `absltest` is built on top of `unittest`, it will follow this behavior change in Python 3.12.However, when test filtering is used in `absltest`, often used via `bazel test --test_filter=<my_filter>`, the current user expectation is the `bazel test` command should NOT fail is at least one test ran. Since the test runner here has no visibility of the overall `bazel` invocation, we'll make the test not fail when test filtering is used. This is the existing behavior before Python 3.12.Also test absl-py on Python 3.12.PiperOrigin-RevId: 565190992
copybara-servicebot pushed a commit to abseil/abseil-py that referenced this pull requestSep 14, 2023
- Either test filtering is used- Sharding is used and the shard index > 0, i.e. only the first shard will fail when no tests ran on Python 3.12+.Context: Python 3.12 unittest will now fail when no tests ran after the change frompython/cpython#102051. Since `absltest` is built on top of `unittest`, it will follow this behavior change in Python 3.12.However, when test filtering is used in `absltest`, often used via `bazel test --test_filter=<my_filter>`, the current user expectation is the `bazel test` command should NOT fail is at least one test ran. Since the test runner here has no visibility of the overall `bazel` invocation, we'll make the test not fail when test filtering is used. This is the existing behavior before Python 3.12.Also test absl-py on Python 3.12.PiperOrigin-RevId: 565190992
copybara-servicebot pushed a commit to abseil/abseil-py that referenced this pull requestSep 14, 2023
- Either test filtering is used- Sharding is used and the shard index > 0, i.e. only the first shard will fail when no tests ran on Python 3.12+.Context: Python 3.12 unittest will now fail when no tests ran after the change frompython/cpython#102051. Since `absltest` is built on top of `unittest`, it will follow this behavior change in Python 3.12.However, when test filtering is used in `absltest`, often used via `bazel test --test_filter=<my_filter>`, the current user expectation is the `bazel test` command should NOT fail is at least one test ran. Since the test runner here has no visibility of the overall `bazel` invocation, we'll make the test not fail when test filtering is used via bazel's environment variable. This is the existing behavior before Python 3.12.Also test absl-py on Python 3.12.PiperOrigin-RevId: 565190992
copybara-servicebot pushed a commit to abseil/abseil-py that referenced this pull requestSep 14, 2023
- Either test filtering is used- Sharding is used and the shard index > 0, i.e. only the first shard will fail when no tests ran on Python 3.12+.Context: Python 3.12 unittest will now fail when no tests ran after the change frompython/cpython#102051. Since `absltest` is built on top of `unittest`, it will follow this behavior change in Python 3.12.However, when test filtering is used in `absltest`, often used via `bazel test --test_filter=<my_filter>`, the current user expectation is the `bazel test` command should NOT fail is at least one test ran. Since the test runner here has no visibility of the overall `bazel` invocation, we'll make the test not fail when test filtering is used via bazel's environment variable. This is the existing behavior before Python 3.12.Also test absl-py on Python 3.12.PiperOrigin-RevId: 565190992
copybara-servicebot pushed a commit to abseil/abseil-py that referenced this pull requestSep 14, 2023
- Either test filtering is used- Or sharding is used and the shard index > 0, i.e. only the first shard will fail when no tests ran on Python 3.12+.Context: Python 3.12 unittest will now fail when no tests ran after the change frompython/cpython#102051. Since `absltest` is built on top of `unittest`, it will follow this behavior change in Python 3.12.However, when test filtering is used in `absltest`, often used via `bazel test --test_filter=<my_filter>`, the current user expectation is the `bazel test` command should NOT fail is at least one test ran. Since the test runner here has no visibility of the overall `bazel` invocation, we'll make the test not fail when test filtering is used via bazel's environment variable. This is the existing behavior before Python 3.12.Also test absl-py on Python 3.12.PiperOrigin-RevId: 565190992
copybara-servicebot pushed a commit to abseil/abseil-py that referenced this pull requestSep 14, 2023
- Either test filtering is used- Or sharding is used and the shard index > 0, i.e. only the first shard will fail when no tests ran on Python 3.12+.Context: Python 3.12 unittest will now fail when no tests ran after the change frompython/cpython#102051. Since `absltest` is built on top of `unittest`, it will follow this behavior change in Python 3.12.However, when test filtering is used in `absltest`, often used via `bazel test --test_filter=<my_filter>`, the current user expectation is the `bazel test` command should NOT fail is at least one test ran. Since the test runner here has no visibility of the overall `bazel` invocation, we'll make the test not fail when test filtering is used via bazel's environment variable. This is the existing behavior before Python 3.12.Also test absl-py on Python 3.12.PiperOrigin-RevId: 565190992
copybara-servicebot pushed a commit to abseil/abseil-py that referenced this pull requestSep 15, 2023
- Either test filtering is used- Or sharding is used and the shard index > 0, i.e. only the first shard will fail when no tests ran on Python 3.12+.Context: Python 3.12 unittest will now fail when no tests ran after the change frompython/cpython#102051. Since `absltest` is built on top of `unittest`, it will follow this behavior change in Python 3.12.However, when test filtering is used in `absltest`, often used via `bazel test --test_filter=<my_filter>`, the current user expectation is the `bazel test` command should NOT fail is at least one test ran. Since the test runner here has no visibility of the overall `bazel` invocation, we'll make the test not fail when test filtering is used via bazel's environment variable. This is the existing behavior before Python 3.12.Also test absl-py on Python 3.12.PiperOrigin-RevId: 565190992
copybara-servicebot pushed a commit to abseil/abseil-py that referenced this pull requestSep 15, 2023
- Either test filtering is used- Or sharding is used and the shard index > 0, i.e. only the first shard will fail when no tests ran on Python 3.12+.Context: Python 3.12 unittest will now fail when no tests ran after the change frompython/cpython#102051. Since `absltest` is built on top of `unittest`, it will follow this behavior change in Python 3.12.However, when test filtering is used in `absltest`, often used via `bazel test --test_filter=<my_filter>`, the current user expectation is the `bazel test` command should NOT fail is at least one test ran. Since the test runner here has no visibility of the overall `bazel` invocation, we'll make the test not fail when test filtering is used via bazel's environment variable. This is the existing behavior before Python 3.12.Also test absl-py on Python 3.12.PiperOrigin-RevId: 565190992
copybara-servicebot pushed a commit to abseil/abseil-py that referenced this pull requestSep 15, 2023
- Either test filtering is used- Or sharding is used and the shard index > 0, i.e. only the first shard will fail when no tests ran on Python 3.12+.Context: Python 3.12 unittest will now fail when no tests ran after the change frompython/cpython#102051. Since `absltest` is built on top of `unittest`, it will follow this behavior change in Python 3.12.However, when test filtering is used in `absltest`, often used via `bazel test --test_filter=<my_filter>`, the current user expectation is the `bazel test` command should NOT fail is at least one test ran. Since the test runner here has no visibility of the overall `bazel` invocation, we'll make the test not fail when test filtering is used via bazel's environment variable. This is the existing behavior before Python 3.12.Also test absl-py on Python 3.12.PiperOrigin-RevId: 565190992
copybara-servicebot pushed a commit to abseil/abseil-py that referenced this pull requestSep 15, 2023
- Either test filtering is used- Or sharding is used and the shard index > 0, i.e. only the first shard will fail when no tests ran on Python 3.12+.Context: Python 3.12 unittest will now fail when no tests ran after the change frompython/cpython#102051. Since `absltest` is built on top of `unittest`, it will follow this behavior change in Python 3.12.However, when test filtering is used in `absltest`, often used via `bazel test --test_filter=<my_filter>`, the current user expectation is the `bazel test` command should NOT fail is at least one test ran. Since the test runner here has no visibility of the overall `bazel` invocation, we'll make the test not fail when test filtering is used via bazel's environment variable. This is the existing behavior before Python 3.12.Also test absl-py on Python 3.12.PiperOrigin-RevId: 565771935
@vstinner
Copy link
Member

The new Python 3.12 message surprises users when all tests are skipped: see issue#113661.

@fishy
Copy link

The PR description says:

It is common for test runner misconfiguration to fail to find any tests

Which seems to suggest that it should not fail test if all tests areskipped, as skipped tests are still "found", just intentionally skipped from running.

@stefanor
Copy link
ContributorAuthor

Which seems to suggest that it should not fail test if all tests are skipped, as skipped tests are still "found", just intentionally skipped from running.

Yeah, I'd agree with that.

texhnolyze added a commit to bit-bots/bitbots_main that referenced this pull requestDec 12, 2024
to ensure that the CI `colcon test` run works, because with a change topython 3.12 the `unittest` standard library used by default with colconnow exits with an error code of 5 for an empty test suite.See:colcon/colcon-core#678See:python/cpython#102051
texhnolyze added a commit to bit-bots/udp_bridge that referenced this pull requestDec 16, 2024
to ensure that the CI `colcon test` run works, because with a change topython 3.12 the `unittest` standard library used by default with colconnow exits with an error code of 5 for an empty test suite.Additionally removed old ros 1 integration tests.See:colcon/colcon-core#678See:python/cpython#102051
texhnolyze added a commit to bit-bots/dynamic_stack_decider that referenced this pull requestDec 16, 2024
to ensure that the CI `colcon test` run works, because with a change topython 3.12 the `unittest` standard library used by default with colconnow exits with an error code of 5 for an empty test suite.See:colcon/colcon-core#678See:python/cpython#102051
texhnolyze added a commit to bit-bots/udp_bridge that referenced this pull requestDec 16, 2024
to ensure that the CI `colcon test` run works, because with a change topython 3.12 the `unittest` standard library used by default with colconnow exits with an error code of 5 for an empty test suite.Additionally removed old ros 1 integration tests.See:colcon/colcon-core#678See:python/cpython#102051
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@gpsheadgpsheadgpshead approved these changes

@hugovkhugovkAwaiting requested review from hugovk

@ezio-melottiezio-melottiAwaiting requested review from ezio-melotti

Assignees

@gpsheadgpshead

Labels

3.12only security fixestestsTests in the Lib/test dirtype-featureA feature request or enhancement

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

running a suite with no tests is not an error

9 participants

@stefanor@terryjreedy@vstinner@fishy@gpshead@hugovk@bedevere-bot@hauntsaninja@AlexWaygood

[8]ページ先頭

©2009-2025 Movatter.jp