You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Only enable CI mode is $CI or $BUILD_NUMBER is set to a non-empty string
Previously, if either env variable was defined, CI mode would be activated,
even if the variable was set to the empty string.
This had some unfortunate consequences:
* The easy and obvious method of setting those variables,
i.e. `CI="${OTHER_VAR}"`,
would not work,
because `$CI` would always end up being defined
even if `$OTHER_VAR` was undefined.
* The easy and obvious method of clearing those variables at runtime,
i.e. `CI="" pytest ...`,
would not work,
because again `$CI` would still be defined even though it was blank.
Now, at least one of those variables must be set to a non-empty string
in order to enabled CI mode.
Closes#13766
Copy file name to clipboardExpand all lines: doc/en/reference/reference.rst
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1165,11 +1165,11 @@ Environment variables that can be used to change pytest's behavior.
1165
1165
1166
1166
.. envvar:: CI
1167
1167
1168
-
When set (regardless of value), pytest acknowledges that is running in a CI process. Alternative to ``BUILD_NUMBER`` variable. See also :ref:`ci-pipelines`.
1168
+
When set to a non-empty value, pytest acknowledges that is running in a CI process. See also :ref:`ci-pipelines`.
1169
1169
1170
1170
.. envvar:: BUILD_NUMBER
1171
1171
1172
-
When set (regardless of value), pytest acknowledges that is running in a CI process. Alternative to CI variable. See also :ref:`ci-pipelines`.
1172
+
When set to a non-empty value, pytest acknowledges that is running in a CI process. Alternative to :envvar:`CI`. See also :ref:`ci-pipelines`.
1173
1173
1174
1174
.. envvar:: PYTEST_ADDOPTS
1175
1175
@@ -2408,7 +2408,7 @@ All the command-line flags can be obtained by running ``pytest --help``::
2408
2408
Plugins that must be present for pytest to run
2409
2409
2410
2410
Environment variables:
2411
-
CI When set (regardless of value), pytest knows it is running in a CI process and does not truncate summary info
2411
+
CI When set to a non-empty value, pytest knows it is running in a CI process and does not truncate summary info
2412
2412
BUILD_NUMBER Equivalent to CI
2413
2413
PYTEST_ADDOPTS Extra command line options
2414
2414
PYTEST_PLUGINS Comma-separated plugins to load during startup
0 commit comments