mypy icon indicating copy to clipboard operation
mypy copied to clipboard

Refactor: Extracted out/outN parsing logic from parse_test_case

Open LeoLomardo opened this issue 2 months ago • 1 comments

Partially addresses #5917.

This PR refactors the parse_test_case function in mypy/test/data.py by extracting the logic that parses [out] and [outN] sections into a new private helper, _handle_out_section(). This reduces the size and nesting of parse_test_case and makes its responsibilities clearer.

Note: This is a partial refactor from #5917. Only parse_test_case is updated in this PR; the remaining refactoring work described in the issue is intentionally left for follow-up changes.

No behavior changes are intended. No new tests were added; the existing test suite passes, confirming that this refactor is functionally neutral.

LeoLomardo avatar Nov 04 '25 11:11 LeoLomardo

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

github-actions[bot] avatar Nov 04 '25 11:11 github-actions[bot]