Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
As discussed inhttps://discuss.python.org/t/unittest-fail-if-zero-tests-were-discovered/21498/7It is common for test runner misconfiguration to fail to find any tests,this should be an error.Fixes:python#62432
terryjreedy commentedFeb 20, 2023
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. |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Misc/NEWS.d/next/Library/2023-02-19-12-37-08.gh-issue-62432.GnBFIB.rst OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
stefanor commentedFeb 20, 2023
Urgh, that removal wasn't intentional, I just hit the re-request review button. |
stefanor commentedApr 26, 2023
@gpshead: Ping? (it's been 2 months) |
stefanor commentedApr 27, 2023
Thank you! |
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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 commentedJan 8, 2024
The new Python 3.12 message surprises users when all tests are skipped: see issue#113661. |
fishy commentedJan 8, 2024
The PR description says:
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 commentedJan 9, 2024
Yeah, I'd agree with that. |
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
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
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
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
Uh oh!
There was an error while loading.Please reload this page.
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