From e20b39d92814a19db57bdace8d7c84bf4f39b557 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Fri, 5 Apr 2019 15:13:35 +0200 Subject: [PATCH] showhelp: move tw.fullwidth out of the loop --- src/_pytest/helpconfig.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/_pytest/helpconfig.py b/src/_pytest/helpconfig.py index 8117ee6bc..2b383d264 100644 --- a/src/_pytest/helpconfig.py +++ b/src/_pytest/helpconfig.py @@ -151,13 +151,14 @@ def showhelp(config): ) tw.line() + columns = tw.fullwidth # costly call for name in config._parser._ininames: help, type, default = config._parser._inidict[name] if type is None: type = "string" spec = "%s (%s)" % (name, type) line = " %-24s %s" % (spec, help) - tw.line(line[: tw.fullwidth]) + tw.line(line[:columns]) tw.line() tw.line("environment variables:")