diff --git a/doc/en/reference.rst b/doc/en/reference.rst index 0b168eb54..3b1d3f262 100644 --- a/doc/en/reference.rst +++ b/doc/en/reference.rst @@ -727,6 +727,14 @@ ExceptionInfo .. autoclass:: _pytest._code.ExceptionInfo :members: + +pytest.ExitCode +~~~~~~~~~~~~~~~ + +.. autoclass:: _pytest.main.ExitCode + :members: + + FixtureDef ~~~~~~~~~~ diff --git a/src/_pytest/main.py b/src/_pytest/main.py index 3aa36c80f..3d0d95e8d 100644 --- a/src/_pytest/main.py +++ b/src/_pytest/main.py @@ -19,15 +19,23 @@ from _pytest.deprecated import PYTEST_CONFIG_GLOBAL from _pytest.outcomes import exit from _pytest.runner import collect_one_node -# exitcodes for the command line - class ExitCode(enum.IntEnum): + """ + encodes the valid exit codes of pytest + currently users may still supply other exit codes as well + """ + #: tests passed OK = 0 + #: tests failed TESTS_FAILED = 1 + #: pytest was interrupted INTERRUPTED = 2 + #: an internal error got in the way INTERNAL_ERROR = 3 + #: pytest was missused USAGE_ERROR = 4 + #: pytest couldnt find tests NO_TESTS_COLLECTED = 5