summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2022-12-03 12:12:49 -0500
committerNed Batchelder <ned@nedbatchelder.com>2022-12-03 12:19:24 -0500
commit97adfe828dc3952c1bc3f2010c541b59eace1df4 (patch)
tree1175c6bb83bea597dee72031409d0fddae5ca863
parent75a789fad14770382448c24b479bc484a8c058b8 (diff)
downloadpython-coveragepy-git-97adfe828dc3952c1bc3f2010c541b59eace1df4.tar.gz
test: setting COLUMNS=80 broadly makes pytest too narrow
Better to set it precisely where it is needed. This also ensures that running cog from the Makefile will get the right results.
-rw-r--r--doc/cmd.rst6
-rw-r--r--tox.ini3
2 files changed, 6 insertions, 3 deletions
diff --git a/doc/cmd.rst b/doc/cmd.rst
index 663ca708..c1f52ee7 100644
--- a/doc/cmd.rst
+++ b/doc/cmd.rst
@@ -6,6 +6,12 @@
Running "make prebuild" will bring it up to date.
.. [[[cog
+ # optparse wraps help to the COLUMNS value. Set it here to be sure it's
+ # consistent regardless of the environment. Has to be set before we
+ # import cmdline.py, which creates the optparse objects.
+ import os
+ os.environ["COLUMNS"] = "80"
+
import contextlib
import io
import re
diff --git a/tox.ini b/tox.ini
index 97aa021f..4a410aa7 100644
--- a/tox.ini
+++ b/tox.ini
@@ -31,9 +31,6 @@ setenv =
# For some tests, we need .pyc files written in the current directory,
# so override any local setting.
PYTHONPYCACHEPREFIX=
- # Cog'ing the --help output depends on the width of the terminal,
- # so set it explicitly to avoid environmental interference
- COLUMNS=80
commands =
# Create tests/zipmods.zip