test: update reasoning-effort docstring guards for new 'max' level

Follow-up to salvaged #57601. Adding "max" to VALID_REASONING_EFFORTS
made parse_reasoning_effort("max") valid, so:
- test_unknown_levels_return_none no longer lists "max" (it is now valid;
  auto-covered by test_each_valid_level which iterates the tuple).
- test_known_supported_levels_are_documented and the parse_reasoning_effort
  docstring now include "max" so the doc-sync guard actually protects it.
This commit is contained in:
kshitijk4poor 2026-07-04 13:51:26 +05:30 committed by kshitij
parent f69a33794b
commit a1c17edcbb
2 changed files with 6 additions and 6 deletions

View file

@ -797,7 +797,7 @@ VALID_REASONING_EFFORTS = ("minimal", "low", "medium", "high", "xhigh", "max")
def parse_reasoning_effort(effort) -> dict | None:
"""Parse a reasoning effort level into a config dict.
Valid levels: "none", "minimal", "low", "medium", "high", "xhigh".
Valid levels: "none", "minimal", "low", "medium", "high", "xhigh", "max".
Returns None when the input is empty or unrecognized (caller uses default).
Returns {"enabled": False} for "none" (aliases: "false", "disabled", and
YAML boolean False users write ``reasoning_effort: false``/``off``/``no``

View file

@ -473,7 +473,7 @@ class TestParseReasoningEffort:
@pytest.mark.parametrize(
"value",
["bogus", "very-high", "max", "0", "off", "true", "default"],
["bogus", "very-high", "0", "off", "true", "default"],
)
def test_unknown_levels_return_none(self, value):
"""Unrecognized strings fall back to the caller default (None)."""
@ -482,11 +482,11 @@ class TestParseReasoningEffort:
def test_known_supported_levels_are_documented(self):
"""Guard against silently dropping a documented level.
The docstring promises "minimal", "low", "medium", "high", "xhigh".
If someone removes one from VALID_REASONING_EFFORTS without updating
the docstring, this test will fail and force the call out.
The docstring promises "minimal", "low", "medium", "high", "xhigh",
"max". If someone removes one from VALID_REASONING_EFFORTS without
updating the docstring, this test will fail and force the call out.
"""
documented = {"minimal", "low", "medium", "high", "xhigh"}
documented = {"minimal", "low", "medium", "high", "xhigh", "max"}
assert documented.issubset(set(VALID_REASONING_EFFORTS))