Skip to content

Commit 1b89e4f

Browse files
committed
config: remove Parser._ininames
Doesn't seem needed. Maybe it was useful before dicts had guaranteed iteration order? `pytest --help` output is unchanged.
1 parent 7fc91fe commit 1b89e4f

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

src/_pytest/config/argparsing.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ def __init__(
5151
self._processopt = processopt
5252
self._usage = usage
5353
self._inidict: dict[str, tuple[str, str, Any]] = {}
54-
self._ininames: list[str] = []
5554
# Maps alias -> canonical name.
5655
self._ini_aliases: dict[str, str] = {}
5756
self.extra_info: dict[str, Any] = {}
@@ -244,7 +243,6 @@ def addini(
244243
default = get_ini_default_for_type(type)
245244

246245
self._inidict[name] = (help, type, default)
247-
self._ininames.append(name)
248246

249247
for alias in aliases:
250248
if alias in self._inidict:

src/_pytest/helpconfig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def showhelp(config: Config) -> None:
184184
columns = tw.fullwidth # costly call
185185
indent_len = 24 # based on argparse's max_help_position=24
186186
indent = " " * indent_len
187-
for name in config._parser._ininames:
187+
for name in config._parser._inidict:
188188
help, type, _default = config._parser._inidict[name]
189189
if help is None:
190190
raise TypeError(f"help argument cannot be None for {name}")

0 commit comments

Comments
 (0)