@@ -1083,7 +1083,6 @@ def __init__(
10831083 self .trace = self .pluginmanager .trace .root .get ("config" )
10841084 self .hook : pluggy .HookRelay = PathAwareHookProxy (self .pluginmanager .hook ) # type: ignore[assignment]
10851085 self ._inicache : dict [str , Any ] = {}
1086- self ._opt2dest : dict [str , str ] = {}
10871086 self ._cleanup_stack = contextlib .ExitStack ()
10881087 self .pluginmanager .register (self , "pytestconfig" )
10891088 self ._configured = False
@@ -1208,9 +1207,6 @@ def fromdictargs(cls, option_dict: Mapping[str, Any], args: list[str]) -> Config
12081207 return config
12091208
12101209 def _processopt (self , opt : Argument ) -> None :
1211- for name in opt .names ():
1212- self ._opt2dest [name ] = opt .dest
1213-
12141210 if not hasattr (self .option , opt .dest ):
12151211 setattr (self .option , opt .dest , opt .default )
12161212
@@ -1842,7 +1838,7 @@ def getoption(self, name: str, default: Any = NOTSET, skip: bool = False):
18421838 :param skip: If ``True``, raise :func:`pytest.skip` if option is undeclared or has a ``None`` value.
18431839 Note that even if ``True``, if a default was specified it will be returned instead of a skip.
18441840 """
1845- name = self ._opt2dest .get (name , name )
1841+ name = self ._parser . _opt2dest .get (name , name )
18461842 try :
18471843 val = getattr (self .option , name )
18481844 if val is None and skip :
0 commit comments