From 047ba83dabe492af938104fe0058597f67a672be Mon Sep 17 00:00:00 2001 From: Arthur Richard Date: Thu, 14 Dec 2023 12:14:36 +0100 Subject: [PATCH] Improve pytest.exit docs (#11698) Fixes #11695 --- AUTHORS | 1 + doc/en/reference/reference.rst | 2 +- src/_pytest/outcomes.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index 669ec537e..bb273edcc 100644 --- a/AUTHORS +++ b/AUTHORS @@ -48,6 +48,7 @@ Ariel Pillemer Armin Rigo Aron Coyle Aron Curzon +Arthur Richard Ashish Kurmi Aviral Verma Aviv Palivoda diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index d6f942ad0..3054109ba 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -79,7 +79,7 @@ pytest.xfail pytest.exit ~~~~~~~~~~~ -.. autofunction:: pytest.exit(reason, [returncode=False, msg=None]) +.. autofunction:: pytest.exit(reason, [returncode=None, msg=None]) pytest.main ~~~~~~~~~~~ diff --git a/src/_pytest/outcomes.py b/src/_pytest/outcomes.py index a8984c5b9..0f64f91d9 100644 --- a/src/_pytest/outcomes.py +++ b/src/_pytest/outcomes.py @@ -112,7 +112,7 @@ def exit( only because `msg` is deprecated. :param returncode: - Return code to be used when exiting pytest. + Return code to be used when exiting pytest. None means the same as ``0`` (no error), same as :func:`sys.exit`. :param msg: Same as ``reason``, but deprecated. Will be removed in a future version, use ``reason`` instead.