Skip to content

Commit d6d59fe

Browse files
committed
Added details about PYTEST_VERSION to doc/en/reference/reference.rst
1 parent 237ea1a commit d6d59fe

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

doc/en/reference/reference.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,6 +1117,11 @@ When set (regardless of value), pytest acknowledges that is running in a CI proc
11171117
This contains a command-line (parsed by the py:mod:`shlex` module) that will be **prepended** to the command line given
11181118
by the user, see :ref:`adding default options` for more information.
11191119

1120+
.. envvar:: PYTEST_VERSION
1121+
1122+
This environment variable is defined at the start of the pytest session and is undefined afterwards.
1123+
It contains the value of ``pytest.__version__``, and among other things can be used to easily check if a code is running from within a pytest run.
1124+
11201125
.. envvar:: PYTEST_CURRENT_TEST
11211126

11221127
This is not meant to be set by users, but is set by pytest internally with the name of the current test so other

0 commit comments

Comments
 (0)