Only enable CI mode is $CI or $BUILD_NUMBER is set to a non-empty string#13772
Merged
bluetech merged 1 commit intopytest-dev:mainfrom Oct 1, 2025
Merged
Only enable CI mode is $CI or $BUILD_NUMBER is set to a non-empty string#13772bluetech merged 1 commit intopytest-dev:mainfrom
$CI or $BUILD_NUMBER is set to a non-empty string#13772bluetech merged 1 commit intopytest-dev:mainfrom
Conversation
Member
|
Thank you for opening the issue, #13767 is moving it elsewhere you'll probably need to rebase on it when it's merged. |
bluetech
approved these changes
Oct 1, 2025
Member
bluetech
left a comment
There was a problem hiding this comment.
Thanks!
No worries about the rebase, I will handle it, along with a few minor changes. Out of abundance of caution I will also mark this a breaking change. The next release is 9.0 so that's OK :)
… 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 pytest-dev#13766
cfe90bc to
304743c
Compare
Member
|
macos CI is down, I doubt it's relevant here, so force-merging. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, if either
$CIor$BUILD_NUMBERwas defined, CI mode would be activated, even if the variable was set to the empty string. This had some unfortunate consequences:CI="${OTHER_VAR}", would not work, because$CIwould always end up being defined even if$OTHER_VARwas undefined.CI="" pytest ..., would not work, because again$CIwould 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 enable CI mode.
Closes #13766