Backtestspytestrun-20261106-234554#14953
max_warnings rejects the integer shown in the native TOML documentation
Our patch was judged better than the merged fix.
In this judgment, Patch A = our agent, Patch B = the merged fix.
Both patches fix the root cause by registering `max_warnings` as a str/int union and rewriting `_get_max_warnings` so a native TOML `0` is not treated as unset; the independent tests confirm both pass every scenario, including zero, pyproject, unset, INI, `-o`, and CLI precedence. Correctness: Patch A keeps the empty-string default and checks `ini_value == ""`, which preserves the prior behaviour for an empty INI value. Patch B changes the default to `None` and does `int()` on any string, so an empty `max_warnings =` line in pytest.ini (previously treated as unset via the truthiness check) would now raise ValueError. Minor, but A is slightly more careful at the edge the issue explicitly calls out (distinguishing 0 from unset). Tests: A adds a strong suite: zero and nonzero, quoted and unquoted, in both pytest.toml and pyproject.toml, a not-exceeded case, CLI-overrides-TOML, `-o max_warnings=0`, and a getini type check. B adds a single parametrized test with value 1 only, never exercising the zero regression case the issue highlights as essential. Scope: A goes beyond the ask by also changing `faulthandler_timeout` to `str | float` and editing an unrelated `minversion` doc example. That is extra risk (e.g. whether a native TOML int satisfies the float member cannot be verified here) and counts against A, but it is isolated and does not obscure the max_warnings fix. B stays tightly scoped and updates the confval type and help text in the reference docs, which A omits; B also adds an AUTHORS entry. On balance, A's more rigorous handling of the unset/zero distinction and much stronger regression coverage outweigh its scope creep and missing doc type update.
Four judges ruled on this ticket in parallel, and the verdict comes from counting their votes. Each saw the issue and the two patches, labelled A and B in random order (two of them saw ours as A), with issue links and version numbers removed. Where tests could check the fix, they also saw the results of tests a separate agent wrote for the issue, run on both patches. None was told which patch was ours. The reasoning above is one judge's, shown verbatim.
Solve
4m 45s
Wall-clock time in the container
Full test suite
No new failures
542 passed · 10 skipped · 552 total
Contamination audit
Clean
No sign the agent saw the real fix
Patch size
132vs 33 merged
Changed lines, ours vs merged