summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorStefano Rivera <stefano@rivera.za.net>2023-04-27 01:28:46 (GMT)
committerGitHub <noreply@github.com>2023-04-27 01:28:46 (GMT)
commit76632b836cf81a95301f4eb1fa43682e8d9ffa67 (patch)
treee34dfe04b641f614b06423ff7abd853d765e452d /Doc/library
parentdc3f97549a8fe4f7fea8d0326e394760b51caa6e (diff)
downloadcpython-76632b836cf81a95301f4eb1fa43682e8d9ffa67.zip
cpython-76632b836cf81a95301f4eb1fa43682e8d9ffa67.tar.gz
cpython-76632b836cf81a95301f4eb1fa43682e8d9ffa67.tar.bz2
gh-62432: unittest runner: Exit code 5 if no tests were run (#102051)
As discussed in https://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
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/unittest.rst3
1 files changed, 2 insertions, 1 deletions
diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst
index a7c74cf..c70153d 100644
--- a/Doc/library/unittest.rst
+++ b/Doc/library/unittest.rst
@@ -2281,7 +2281,8 @@ Loading and running tests
The *testRunner* argument can either be a test runner class or an already
created instance of it. By default ``main`` calls :func:`sys.exit` with
- an exit code indicating success or failure of the tests run.
+ an exit code indicating success (0) or failure (1) of the tests run.
+ An exit code of 5 indicates that no tests were run.
The *testLoader* argument has to be a :class:`TestLoader` instance,
and defaults to :data:`defaultTestLoader`.