From c94879d15ebad56ca02d99433d2832d730b67ee5 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Wed, 12 Nov 2025 09:15:21 -0300 Subject: [PATCH] regendoc: remove CI environment variables (#13950) pytest auto-detects and uses more verbose output when running in CI. Change tox:regendoc to remove those environment variables, because we do not want extra verbose output in the user documentation. See #13938 (comment). (cherry picked from commit 82e9b97caf576de2144b414c58edc87fed5873e7) --- src/_pytest/compat.py | 1 + tox.ini | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/_pytest/compat.py b/src/_pytest/compat.py index 2f5a4c863f9..72c3d0918fb 100644 --- a/src/_pytest/compat.py +++ b/src/_pytest/compat.py @@ -309,5 +309,6 @@ def __call__(self) -> bool: def running_on_ci() -> bool: """Check if we're currently running on a CI system.""" # Only enable CI mode if one of these env variables is defined and non-empty. + # Note: review `regendoc` tox env in case this list is changed. env_vars = ["CI", "BUILD_NUMBER"] return any(os.environ.get(var) for var in env_vars) diff --git a/tox.ini b/tox.ini index 2e91ddcb2d6..70b439f7573 100644 --- a/tox.ini +++ b/tox.ini @@ -171,6 +171,10 @@ commands = setenv = # We don't want this warning to reach regen output. PYTHONWARNDEFAULTENCODING= + # Remove CI markers: pytest auto-detects those and uses more verbose output, which is undesirable + # for the example documentation. + CI= + BUILD_NUMBER= [testenv:plugins] description =