Skip to content

Commit

Permalink
Fix ambiguous docstring of pytest.Config
Browse files Browse the repository at this point in the history
For full context see issue pytest-dev#10558
  • Loading branch information
sus-pe committed Oct 12, 2024
1 parent 397fb34 commit 6e0a219
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelog/10558.doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix ambiguous docstring of `pytest.Config.getoption`.
7 changes: 4 additions & 3 deletions src/_pytest/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1699,9 +1699,10 @@ def getoption(self, name: str, default=notset, skip: bool = False):
:param name: Name of the option. You may also specify
the literal ``--OPT`` option instead of the "dest" option name.
:param default: Default value if no option of that name exists.
:param skip: If True, raise pytest.skip if option does not exists
or has a None value.
:param default: Default value if no option of that name is declared.
Note this parameter will be ignored when the option is declared even if the option's value is None.
:param skip: If True, raise pytest.skip if option is undeclared or has a None value.
Note that even if True, if a default was specified it will be returned instead of a skip.
"""
name = self._opt2dest.get(name, name)
try:
Expand Down

0 comments on commit 6e0a219

Please sign in to comment.