Merge pull request #8697 from bluetech/expose-config

config: expose Config and PytestPluginManager for typing purposes
This commit is contained in:
Ran Benita
2021-05-26 11:20:42 +03:00
committed by GitHub
12 changed files with 53 additions and 40 deletions

View File

@@ -61,7 +61,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a
namespace of doctests.
pytestconfig [session scope]
Session-scoped fixture that returns the :class:`_pytest.config.Config` object.
Session-scoped fixture that returns the :class:`pytest.Config` object.
Example::

View File

@@ -337,7 +337,7 @@ testing directory:
Alternatively you can invoke pytest with the ``-p pytester`` command line
option.
This will allow you to use the :py:class:`pytester <_pytest.pytester.Pytester>`
This will allow you to use the :py:class:`pytester <pytest.Pytester>`
fixture for testing your plugin code.
Let's demonstrate what you can do with the plugin with an example. Imagine we

View File

@@ -179,12 +179,12 @@ Files will only be matched for configuration if:
The files are considered in the order above. Options from multiple ``configfiles`` candidates
are never merged - the first match wins.
The internal :class:`Config <_pytest.config.Config>` object (accessible via hooks or through the :fixture:`pytestconfig` fixture)
The :class:`Config <pytest.Config>` object (accessible via hooks or through the :fixture:`pytestconfig` fixture)
will subsequently carry these attributes:
- :attr:`config.rootpath <_pytest.config.Config.rootpath>`: the determined root directory, guaranteed to exist.
- :attr:`config.rootpath <pytest.Config.rootpath>`: the determined root directory, guaranteed to exist.
- :attr:`config.inipath <_pytest.config.Config.inipath>`: the determined ``configfile``, may be ``None``
- :attr:`config.inipath <pytest.Config.inipath>`: the determined ``configfile``, may be ``None``
(it is named ``inipath`` for historical reasons).
.. versionadded:: 6.1

View File

@@ -787,7 +787,7 @@ CollectReport
Config
~~~~~~
.. autoclass:: _pytest.config.Config()
.. autoclass:: pytest.Config()
:members:
ExceptionInfo
@@ -901,7 +901,7 @@ OptionGroup
PytestPluginManager
~~~~~~~~~~~~~~~~~~~
.. autoclass:: _pytest.config.PytestPluginManager()
.. autoclass:: pytest.PytestPluginManager()
:members:
:undoc-members:
:inherited-members: