Skip to content

Commit 9cd8a15

Browse files
committed
config: small doc improvements
1 parent 2fcf763 commit 9cd8a15

File tree

1 file changed

+25
-7
lines changed

1 file changed

+25
-7
lines changed

src/_pytest/config/__init__.py

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -817,13 +817,13 @@ class Config:
817817
:param PytestPluginManager pluginmanager:
818818
819819
:param InvocationParams invocation_params:
820-
Object containing the parameters regarding the ``pytest.main``
820+
Object containing parameters regarding the :func:`pytest.main`
821821
invocation.
822822
"""
823823

824824
@attr.s(frozen=True)
825825
class InvocationParams:
826-
"""Holds parameters passed during ``pytest.main()``
826+
"""Holds parameters passed during :func:`pytest.main`.
827827
828828
The object attributes are read-only.
829829
@@ -838,11 +838,20 @@ class InvocationParams:
838838
"""
839839

840840
args = attr.ib(type=Tuple[str, ...], converter=_args_converter)
841-
"""Tuple of command-line arguments as passed to ``pytest.main()``."""
841+
"""The command-line arguments as passed to :func:`pytest.main`.
842+
843+
:type: Tuple[str, ...]
844+
"""
842845
plugins = attr.ib(type=Optional[Sequence[Union[str, _PluggyPlugin]]])
843-
"""List of extra plugins, might be `None`."""
846+
"""Extra plugins, might be `None`.
847+
848+
:type: Optional[Sequence[Union[str, plugin]]]
849+
"""
844850
dir = attr.ib(type=Path)
845-
"""Directory from which ``pytest.main()`` was invoked."""
851+
"""The directory from which :func:`pytest.main` was invoked.
852+
853+
:type: pathlib.Path
854+
"""
846855

847856
def __init__(
848857
self,
@@ -864,6 +873,10 @@ def __init__(
864873
"""
865874

866875
self.invocation_params = invocation_params
876+
"""The parameters with which pytest was invoked.
877+
878+
:type: InvocationParams
879+
"""
867880

868881
_a = FILE_OR_DIR
869882
self._parser = Parser(
@@ -873,7 +886,7 @@ def __init__(
873886
self.pluginmanager = pluginmanager
874887
"""The plugin manager handles plugin registration and hook invocation.
875888
876-
:type: PytestPluginManager.
889+
:type: PytestPluginManager
877890
"""
878891

879892
self.trace = self.pluginmanager.trace.root.get("config")
@@ -898,7 +911,12 @@ def __init__(
898911

899912
@property
900913
def invocation_dir(self) -> py.path.local:
901-
"""Backward compatibility."""
914+
"""The directory from which pytest was invoked.
915+
916+
Prefer to use :attr:`invocation_params.dir <InvocationParams.dir>`.
917+
918+
:type: py.path.local
919+
"""
902920
return py.path.local(str(self.invocation_params.dir))
903921

904922
def add_cleanup(self, func: Callable[[], None]) -> None:

0 commit comments

Comments
 (0)