@@ -817,13 +817,13 @@ class Config:
817
817
:param PytestPluginManager pluginmanager:
818
818
819
819
:param InvocationParams invocation_params:
820
- Object containing the parameters regarding the `` pytest.main` `
820
+ Object containing parameters regarding the :func:` pytest.main`
821
821
invocation.
822
822
"""
823
823
824
824
@attr .s (frozen = True )
825
825
class InvocationParams :
826
- """Holds parameters passed during `` pytest.main()``
826
+ """Holds parameters passed during :func:` pytest.main`.
827
827
828
828
The object attributes are read-only.
829
829
@@ -838,11 +838,20 @@ class InvocationParams:
838
838
"""
839
839
840
840
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
+ """
842
845
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
+ """
844
850
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
+ """
846
855
847
856
def __init__ (
848
857
self ,
@@ -864,6 +873,10 @@ def __init__(
864
873
"""
865
874
866
875
self .invocation_params = invocation_params
876
+ """The parameters with which pytest was invoked.
877
+
878
+ :type: InvocationParams
879
+ """
867
880
868
881
_a = FILE_OR_DIR
869
882
self ._parser = Parser (
@@ -873,7 +886,7 @@ def __init__(
873
886
self .pluginmanager = pluginmanager
874
887
"""The plugin manager handles plugin registration and hook invocation.
875
888
876
- :type: PytestPluginManager.
889
+ :type: PytestPluginManager
877
890
"""
878
891
879
892
self .trace = self .pluginmanager .trace .root .get ("config" )
@@ -898,7 +911,12 @@ def __init__(
898
911
899
912
@property
900
913
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
+ """
902
920
return py .path .local (str (self .invocation_params .dir ))
903
921
904
922
def add_cleanup (self , func : Callable [[], None ]) -> None :
0 commit comments