With this pytest.toml:
pytest silently ignores the option without any sort of warning/error.
This is different to a pytest.ini, where
leads to ERROR: .../pytest.ini:1: no section header defined.
One would think that a [pytest] header is not neaded at all, because sections (aka tables) are completely optional in toml, and with the config being in a pytest.toml (and not pyproject.toml), the [pytest] header is optional.
IMHO, we should go that way, and read the toplevel option without a section (and possibly even do so for pytest.ini, at least this is supported by configparser, not sure about inicfg).
Alternatively, pytest should warn/error about there being toplevel options it did not read.
Additionally, a similar issue exists with both TOML and ini if there is a typo in the section name. Again in pyproject.toml this makes perfect sense, but there is no reason there should be a [pytestt] section in either pytest.toml or pytest.ini. If I remember correctly there have been plugins (don't remember which) that have their own section in there and then read that out manually (without pytest's infrastructure), so maybe this should be a warning rather than an error.
With this
pytest.toml:pytest silently ignores the option without any sort of warning/error.
This is different to a
pytest.ini, whereaddopts = -vleads to
ERROR: .../pytest.ini:1: no section header defined.One would think that a
[pytest]header is not neaded at all, because sections (aka tables) are completely optional in toml, and with the config being in apytest.toml(and notpyproject.toml), the[pytest]header is optional.IMHO, we should go that way, and read the toplevel option without a section (and possibly even do so for
pytest.ini, at least this is supported byconfigparser, not sure aboutinicfg).Alternatively, pytest should warn/error about there being toplevel options it did not read.
Additionally, a similar issue exists with both TOML and ini if there is a typo in the section name. Again in
pyproject.tomlthis makes perfect sense, but there is no reason there should be a[pytestt]section in eitherpytest.tomlorpytest.ini. If I remember correctly there have been plugins (don't remember which) that have their own section in there and then read that out manually (without pytest's infrastructure), so maybe this should be a warning rather than an error.