diff --git a/changelog/3086.removal.rst b/changelog/3086.removal.rst new file mode 100644 index 000000000..3974aa500 --- /dev/null +++ b/changelog/3086.removal.rst @@ -0,0 +1,4 @@ +``[pytest]`` section in **setup.cfg** files is not longer supported, use ``[tool:pytest]`` instead. ``setup.cfg`` files +are meant for use with ``distutils``, and a section named ``pytest`` has notoriously been a source of conflicts and bugs. + +Note that for **pytest.ini** and **tox.ini** files the section remains ``[pytest]``. diff --git a/changelog/4548.removal.rst b/changelog/4548.removal.rst new file mode 100644 index 000000000..bd47b1d51 --- /dev/null +++ b/changelog/4548.removal.rst @@ -0,0 +1,3 @@ +An error is now raised if the ``pytest_plugins`` variable is defined in a non-top-level ``conftest.py`` file (i.e., not residing in the ``rootdir``). + +See our `docs `__ for more information. diff --git a/doc/en/deprecations.rst b/doc/en/deprecations.rst index b37be1b7f..ca95bab38 100644 --- a/doc/en/deprecations.rst +++ b/doc/en/deprecations.rst @@ -81,16 +81,6 @@ As part of a large :ref:`marker-revamp`, :meth:`_pytest.nodes.Node.get_marker` i :ref:`the documentation ` on tips on how to update your code. -pytest_plugins in non-top-level conftest files -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. deprecated:: 3.5 - -Defining ``pytest_plugins`` is now deprecated in non-top-level conftest.py -files because they will activate referenced plugins *globally*, which is surprising because for all other pytest -features ``conftest.py`` files are only *active* for tests at or below it. - - marks in ``pytest.mark.parametrize`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -125,15 +115,6 @@ To update the code, use ``pytest.param``: - -[pytest] section in setup.cfg files -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. deprecated:: 3.0 - -``[pytest]`` sections in ``setup.cfg`` files should now be named ``[tool:pytest]`` -to avoid conflicts with other distutils commands. - Result log (``--result-log``) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -185,6 +166,16 @@ Switch over to the ``@pytest.fixture`` decorator: return SomeData() + +[pytest] section in setup.cfg files +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +*Removed in version 4.0.* + +``[pytest]`` sections in ``setup.cfg`` files should now be named ``[tool:pytest]`` +to avoid conflicts with other distutils commands. + + Metafunc.addcall ~~~~~~~~~~~~~~~~ @@ -241,6 +232,16 @@ You can consult `funcarg comparison section in the docs