From 6ee5d431a03795aa4844ede1714cff02be9ba2f4 Mon Sep 17 00:00:00 2001 From: Yoav Caspi Date: Sun, 6 Jan 2019 22:47:40 +0200 Subject: [PATCH 1/4] add warning for using non canonical configuration files. --- doc/en/reference.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/en/reference.rst b/doc/en/reference.rst index 9305cbb95..ac00f5322 100644 --- a/doc/en/reference.rst +++ b/doc/en/reference.rst @@ -889,6 +889,9 @@ Here is a list of builtin configuration options that may be written in a ``pytes file, usually located at the root of your repository. All options must be under a ``[pytest]`` section (``[tool:pytest]`` for ``setup.cfg`` files). +.. warning:: usage of configuration file different than the canonical, i.e. ``pytest.ini`` + can break other tools configurations. + Configuration file options may be overwritten in the command-line by using ``-o/--override``, which can also be passed multiple times. The expected format is ``name=value``. For example:: From 149620f85811c9c47c0eac97a6345cabce04860d Mon Sep 17 00:00:00 2001 From: Yoav Caspi Date: Sun, 6 Jan 2019 22:56:54 +0200 Subject: [PATCH 2/4] update changelog --- changelog/3375.doc.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/3375.doc.rst diff --git a/changelog/3375.doc.rst b/changelog/3375.doc.rst new file mode 100644 index 000000000..8fa7e2272 --- /dev/null +++ b/changelog/3375.doc.rst @@ -0,0 +1 @@ +document that not using the canonical configfile may crash other tools From 2467831913885d718f9eed33733456b3074eec06 Mon Sep 17 00:00:00 2001 From: Yoav Caspi Date: Wed, 9 Jan 2019 23:52:08 +0200 Subject: [PATCH 3/4] rephrase warning section to explain better the issue. --- doc/en/reference.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/en/reference.rst b/doc/en/reference.rst index ac00f5322..92e298a88 100644 --- a/doc/en/reference.rst +++ b/doc/en/reference.rst @@ -889,8 +889,11 @@ Here is a list of builtin configuration options that may be written in a ``pytes file, usually located at the root of your repository. All options must be under a ``[pytest]`` section (``[tool:pytest]`` for ``setup.cfg`` files). -.. warning:: usage of configuration file different than the canonical, i.e. ``pytest.ini`` - can break other tools configurations. +.. warning:: + Usage of ``setup.cfg`` is not recommended unless for very simple use cases. ``.cfg`` + files use a different parser than ``pytest.ini`` and ``tox.ini`` which might cause hard to track + down problems. + When possible, it is recommended to use the latter files to hold your pytest configuration. Configuration file options may be overwritten in the command-line by using ``-o/--override``, which can also be passed multiple times. The expected format is ``name=value``. For example:: From ba8b3be61a0ec53bbfa31ae20d7d7c764a5c7920 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Wed, 9 Jan 2019 20:27:18 -0200 Subject: [PATCH 4/4] Improve CHANGELOG --- changelog/3375.doc.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/3375.doc.rst b/changelog/3375.doc.rst index 8fa7e2272..f7858ff7e 100644 --- a/changelog/3375.doc.rst +++ b/changelog/3375.doc.rst @@ -1 +1 @@ -document that not using the canonical configfile may crash other tools +Document that using ``setup.cfg`` may crash other tools or cause hard to track down problems because it uses a different parser than ``pytest.ini`` or ``tox.ini`` files.