-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
What's the problem this feature will solve?
Provide native support for toml configuration to avail of rich types (and associated editor support), improve alignment across Python tooling; and remove a dependency on two configuration formats (toml & ini) within projects.
Describe the solution you'd like
Native toml support with a standalone pytest.toml
and a [tool.pytest]
section in pyproject.toml
(PEP-518) - with the latter outlined as the intent within pytest configuration documentation.
One might wonder why
[tool.pytest.ini_options]
instead of[tool.pytest]
as is the case with other toolsThe reason is that the pytest team intends to fully utilize the rich TOML data format for configuration in the future, reserving the
[tool.pytest]
table for that. The ini_options table is being used, for now, as a bridge between the existing .ini configuration system and the future configuration format.
Alternative Solutions
Use INI configuration embedded within TOML through the [tool.pytest.ini_options]
section within pyproject.toml
.
Additional context
- implement support for PEP-518 - the tool.pytest key in pyproject.toml #1556
- deprecate setup.cfg support #3523
- xfail_strict has no effect in [tool.pytest] #3675
- Inheritable pytest configuration #13173
tox
implementation 1 October 2024 (native pyproject.toml config tox-dev/tox#999) - migrating from alegacy_tox_ini
key within a[tool.tox]
section. Note: yet to have full parity with all capabilities provided by the ini alternative.
Creating as unable to locate an associated open issue; feel free to close should one exist.