diff --git a/_pytest/config.py b/_pytest/config.py index 359cc4bc8..e8bfeccb4 100644 --- a/_pytest/config.py +++ b/_pytest/config.py @@ -169,7 +169,7 @@ class PytestPluginManager(PluginManager): Overwrites :py:class:`pluggy.PluginManager ` to add pytest-specific functionality: - * loading plugins from the command line, ``PYTEST_PLUGIN`` env variable and + * loading plugins from the command line, ``PYTEST_PLUGINS`` env variable and ``pytest_plugins`` global variables found in plugins being loaded; * ``conftest.py`` loading during start-up; """ diff --git a/doc/en/example/simple.rst b/doc/en/example/simple.rst index 1b1cb829c..b044f43ad 100644 --- a/doc/en/example/simple.rst +++ b/doc/en/example/simple.rst @@ -766,6 +766,8 @@ and run it:: You'll see that the fixture finalizers could use the precise reporting information. +.. _pytest current test env: + ``PYTEST_CURRENT_TEST`` environment variable -------------------------------------------- diff --git a/doc/en/reference.rst b/doc/en/reference.rst index 6a39f7542..3086f9be7 100644 --- a/doc/en/reference.rst +++ b/doc/en/reference.rst @@ -774,4 +774,43 @@ test functions and methods. Can be either a single mark or a sequence of marks. import pytest pytestmark = (pytest.mark.integration, pytest.mark.slow) +PYTEST_DONT_REWRITE (module docstring) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The text ``PYTEST_DONT_REWRITE`` can be add to any **module docstring** to disable +:ref:`assertion rewriting ` for that module. + + +Environment Variables +--------------------- + +Environment variables that can be used to change pytest's behavior. + +PYTEST_ADDOPTS +~~~~~~~~~~~~~~ + +This contains a command-line (parsed by the py:mod:`shlex` module) that will be **prepended** to the command line given +by the user, see :ref:`adding default options` for more information. + +PYTEST_DEBUG +~~~~~~~~~~~~ + +When set, pytest will print tracing and debug information. + +PYTEST_PLUGINS +~~~~~~~~~~~~~~ + +Contains comma-separated list of modules that should be loaded as plugins: + +.. code-block:: bash + + export PYTEST_PLUGINS=mymodule.plugin,xdisst + + +PYTEST_CURRENT_TEST +~~~~~~~~~~~~~~~~~~~ + +This is not meant to be set by users, but is set by pytest internally with the name of the current test so other +processes can inspect it, see :ref:`pytest current test env` for more information. +