From be6d7d6890e6ff2a47f105683511e7f6b5c846b5 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Wed, 12 Nov 2025 08:41:49 -0300 Subject: [PATCH] regendoc: remove CI environment variables 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). --- 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 316d2fbd42b..d3b2a469693 100644 --- a/src/_pytest/compat.py +++ b/src/_pytest/compat.py @@ -310,6 +310,7 @@ 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 8e760e9e2e2..c2db030f0c0 100644 --- a/tox.ini +++ b/tox.ini @@ -168,6 +168,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 =