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 =