-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
Return the correct exit code if all tests have been skipped in unittest
#106584
Comments
Increase the number of running tests only if it hasn't been skipped.
Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com> Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
…6588) Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com> Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Thank you for the fix! |
…ython#106588)" This reverts commit 8fc0713.
I think that it was a wrong change, and not only because it makes import unittest
class TestCase(unittest.TestCase):
def test(self):
self.skipTest("something") But it gets error code 0 while the second example gets error code 5. It also gives a wrong answer to the problem. #113661 fixes it in the opposite way. |
…in Python 3.12 (pythonGH-106588)" (pythonGH-114470) This reverts commit 8fc0713. (cherry picked from commit ecabff9) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
…in Python 3.12 (python#106588)" (pythonGH-114470) This reverts commit 8fc0713.
…in Python 3.12 (python#106588)" (pythonGH-114470) This reverts commit 8fc0713.
Looks like this change has been reverted, and #113661 PRs are merged also, and that issue is closed. Seems there is nothing left to do here? |
…6588) Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com> Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Bug report
In Python 3.12, a new exit code (
5
, instead of0
) was added if all tests were skipped inunittest
. But in some cases it still returns0
. See code examples.Code example 1:
Output:
Ok, we get exit code 5 here.
Code example 2:
Output:
Here we can see output
0
. Ran one test and skipped. But I think it is incorrect, because all tests were skipped.Your environment
Linked PRs
The text was updated successfully, but these errors were encountered: