Skip to content

Accept native TOML numbers for faulthandler_timeout - #15133

Merged
RonnyPfannschmidt merged 1 commit into
pytest-dev:mainfrom
hfycium:codex/faulthandler-toml-type
Oct 9, 2026
Merged

RonnyPfannschmidt merged 1 commit into
pytest-dev:mainfrom
hfycium:codex/faulthandler-toml-type

Conversation

@hfycium

@hfycium hfycium commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Closes #15132

Summary

faulthandler_timeout is documented as a float and supports native TOML configuration, but numeric TOML values were rejected because the option was registered without a type. Register it as float | str so native TOML numbers and existing string values are accepted.

The regression test covers integer, float, and quoted-string TOML values.

Testing

  • uv run --project . pytest --basetemp .test-tmp -q testing/test_faulthandler.py
  • uvx pre-commit run --files src/_pytest/faulthandler.py testing/test_faulthandler.py AUTHORS changelog/15132.bugfix.rst

@psf-chronographer psf-chronographer Bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Oct 5, 2026
@RonnyPfannschmidt
RonnyPfannschmidt merged commit adf183f into pytest-dev:main Oct 9, 2026
35 checks passed
SemTiOne pushed a commit to SemTiOne/pytest that referenced this pull request Oct 9, 2026
Follow-up to pytest-dev#14692, pytest-dev#14954 and pytest-dev#15133: the remaining options whose
values are naturally numbers or booleans were still registered as plain
strings, so native TOML configs had to quote them.

- verbosity_assertions, verbosity_test_cases, verbosity_subtests:
  int | Literal["auto"]
- tmp_path_retention_count: int | str
- log_level, log_cli_level, log_file_level: int | str; int levels are
  now handled directly and an int 0 (NOTSET) still counts as set
- log_auto_indent: int | bool | str
- log_file_mode: Literal["w", "a"] (an invalid value was an INTERNALERROR)
- parametrize_long_str_id_strategy: its Literal choices

The reference docs drop the "must be quoted in TOML" notes, fix the
minversion TOML example (a float there is rejected), fix copy-pasted
log_cli_level examples, and refresh the --help dump.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KnFJBdcVQB59PKYw3q1w7X
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided (automation) changelog entry is part of PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Native TOML numeric faulthandler_timeout is rejected

2 participants