Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Bug report
In Python 3.12, a new exit code (5, instead of0) wasadded if all tests were skipped inunittest. But in some cases it still returns0. See code examples.
Code example 1:
importunittestclassTestSimple(unittest.TestCase):@classmethoddefsetUpClass(cls):raiseunittest.SkipTest("Skip whole Case")deftest_true(self):self.assertTrue(True)deftest_false(self):self.assertTrue(False,msg="Is not True")
Output:
Ran 0 tests in 0.000sNO TESTS RAN (skipped=1)Ok, we get exit code 5 here.
Code example 2:
importunittestclassTestCase(unittest.TestCase):@unittest.skip("something")deftest(self):self.assertTrue(False)
Output:
Ran 1 test in 0.000sOK (skipped=1)Here we can see output0. Ran one test and skipped. But I think it is incorrect, because all tests were skipped.
Your environment
- CPython versions tested on: 3.12
- Operating system and architecture: I think it does not matter.
Linked PRs
Metadata
Metadata
Assignees
Labels
Projects
Status
Done