From d940fc83836c33b585ba39bf4ef7fb8669baf240 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 14 Jun 2022 07:44:39 -0300 Subject: [PATCH] Add test and improve docs --- doc/en/reference/reference.rst | 7 ++++--- testing/test_config.py | 11 ++++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index d08269725..97fe20f5a 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -1151,9 +1151,10 @@ Consult the :ref:`internal-warnings` section in the documentation for more infor Configuration Options --------------------- -Here is a list of builtin configuration options that may be written in a ``pytest.ini``, ``pyproject.toml``, ``tox.ini`` or ``setup.cfg`` -file, usually located at the root of your repository. To see each file format in details, see -:ref:`config file formats`. +Here is a list of builtin configuration options that may be written in a ``pytest.ini`` (or ``.pytest.ini``), +``pyproject.toml``, ``tox.ini``, or ``setup.cfg`` file, usually located at the root of your repository. + +To see each file format in details, see :ref:`config file formats`. .. warning:: Usage of ``setup.cfg`` is not recommended except for very simple use cases. ``.cfg`` diff --git a/testing/test_config.py b/testing/test_config.py index b2c74085e..ca2ddd0af 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -112,21 +112,26 @@ class TestParseIni: @pytest.mark.parametrize( "section, name", - [("tool:pytest", "setup.cfg"), ("pytest", "tox.ini"), ("pytest", "pytest.ini")], + [ + ("tool:pytest", "setup.cfg"), + ("pytest", "tox.ini"), + ("pytest", "pytest.ini"), + ("pytest", ".pytest.ini"), + ], ) def test_ini_names(self, pytester: Pytester, name, section) -> None: pytester.path.joinpath(name).write_text( textwrap.dedent( """ [{section}] - minversion = 1.0 + minversion = 3.36 """.format( section=section ) ) ) config = pytester.parseconfig() - assert config.getini("minversion") == "1.0" + assert config.getini("minversion") == "3.36" def test_pyproject_toml(self, pytester: Pytester) -> None: pytester.makepyprojecttoml(