You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TOML config opts verbosity_assertions, verbosity_subtests, & verbosity_test_cases no longer accept numeric string values in 9.2.0 #15290
As of version 9.2.0, the options verbosity_assertions, verbosity_subtests, & verbosity_test_cases no longer accept numeric string values in pyproject.toml configuration files.
Despite the changelog entry stating that they still accept numeric string values for backwards compatibility, they only accept integer values or 'auto'.
I reproduced the 9.2.0 regression and opened #15294 with focused TOML numeric-string coverage for the three verbosity options. The compatibility path is limited to the built-in verbosity settings; generic plugin int | str and int | Literal[...] unions remain strict.
3. This is a frustrating regression since my project's config only works with pytest<9.2.0 as-is, and if I adjust the config for latest pytest then it will only work with pytest>=9.2.0. I can't seem to find any workaround that will preserve my settings and satisfy both <9.2.0 and 9.2.0.
this ... removes a intentional tightening of the behavior
this pr accepts the old way again, but with a deprecation warning. either way, the only workaround will be to check pytest's version first, or to require a certain version
Activity
Lpk124 commentedon Oct 29, 2026
I reproduced the 9.2.0 regression and opened #15294 with focused TOML numeric-string coverage for the three verbosity options. The compatibility path is limited to the built-in verbosity settings; generic plugin
int | strandint | Literal[...]unions remain strict.bashonly commentedon Oct 29, 2026
Edit: using
tool.pytest.ini_optionsinstead oftool.pytestinpyproject.tomlis a viable workaround. Thanks @yardenacyardenac commentedon Oct 29, 2026
it seems this was intentional:
this pr accepts the old way again, but with a deprecation warning. either way, the only workaround will be to check pytest's version first, or to require a certain version
EDIT: ... or to use ini_options
[misc] Use `ini_options` table for pytest config (#17952)
Accept numeric strings for verbosity options in native TOML again