summaryrefslogtreecommitdiffstats
path: root/Lib/unittest/main.py
diff options
context:
space:
mode:
authorStefano Rivera <stefano@rivera.za.net>2024-01-09 19:50:01 (GMT)
committerGitHub <noreply@github.com>2024-01-09 19:50:01 (GMT)
commit3a9096c337c16c9335e0d4eba8d1d4196258af72 (patch)
treeb8c47dbf94a29a8ca02dc5219197b196918be441 /Lib/unittest/main.py
parent0297418cacf998e778bc0517aa11eaac827b8c0f (diff)
downloadcpython-3a9096c337c16c9335e0d4eba8d1d4196258af72.zip
cpython-3a9096c337c16c9335e0d4eba8d1d4196258af72.tar.gz
cpython-3a9096c337c16c9335e0d4eba8d1d4196258af72.tar.bz2
GH-113661: unittest runner: Don't exit 5 if tests were skipped (#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.
Diffstat (limited to 'Lib/unittest/main.py')
-rw-r--r--Lib/unittest/main.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/unittest/main.py b/Lib/unittest/main.py
index d29a9f9..c3869de 100644
--- a/Lib/unittest/main.py
+++ b/Lib/unittest/main.py
@@ -269,7 +269,7 @@ class TestProgram(object):
testRunner = self.testRunner
self.result = testRunner.run(self.test)
if self.exit:
- if self.result.testsRun == 0:
+ if self.result.testsRun == 0 and len(self.result.skipped) == 0:
sys.exit(_NO_TESTS_EXITCODE)
elif self.result.wasSuccessful():
sys.exit(0)