Skip to content

Commit 4abf95b

Browse files
authored
Merge pull request #5644 from blueyed/rm-_orig_args
Replace internal config._origargs with invocation_params.args
2 parents c05fcc8 + 3c74389 commit 4abf95b

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/_pytest/config/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -632,10 +632,10 @@ class Config:
632632
Object containing the parameters regarding the ``pytest.main``
633633
invocation.
634634
635-
Contains the followinig read-only attributes:
635+
Contains the following read-only attributes:
636636
637637
* ``args``: list of command-line arguments as passed to ``pytest.main()``.
638-
* ``plugins``: list of extra plugins, might be None
638+
* ``plugins``: list of extra plugins, might be None.
639639
* ``dir``: directory where ``pytest.main()`` was invoked from.
640640
"""
641641

@@ -915,7 +915,7 @@ def parse(self, args, addopts=True):
915915
assert not hasattr(
916916
self, "args"
917917
), "can only parse cmdline args at most once per Config object"
918-
self._origargs = args
918+
assert self.invocation_params.args == args
919919
self.hook.pytest_addhooks.call_historic(
920920
kwargs=dict(pluginmanager=self.pluginmanager)
921921
)

src/_pytest/helpconfig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def pytest_cmdline_parse():
9898
py.__version__,
9999
".".join(map(str, sys.version_info)),
100100
os.getcwd(),
101-
config._origargs,
101+
config.invocation_params.args,
102102
)
103103
)
104104
config.trace.root.setwriter(debugfile.write)

testing/test_config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ def test_basic_behavior(self, _sys_snapshot):
441441
assert config.option.capture == "no"
442442
assert config.args == args
443443

444-
def test_origargs(self, _sys_snapshot):
444+
def test_invocation_params_args(self, _sys_snapshot):
445445
"""Show that fromdictargs can handle args in their "orig" format"""
446446
from _pytest.config import Config
447447

@@ -450,7 +450,7 @@ def test_origargs(self, _sys_snapshot):
450450

451451
config = Config.fromdictargs(option_dict, args)
452452
assert config.args == ["a", "b"]
453-
assert config._origargs == args
453+
assert config.invocation_params.args == args
454454
assert config.option.verbose == 4
455455
assert config.option.capture == "no"
456456

0 commit comments

Comments
 (0)