Skip to content

Move trailing-comma config tests to check tests - #21786

Open
YingqiDuan wants to merge 1 commit into
python:masterfrom
YingqiDuan:move-trailing-comma-config-tests
Open

Move trailing-comma config tests to check tests#21786
YingqiDuan wants to merge 1 commit into
python:masterfrom
YingqiDuan:move-trailing-comma-config-tests

Conversation

@YingqiDuan

@YingqiDuan YingqiDuan commented Jul 29, 2026

Copy link
Copy Markdown

Refs #5966.

This is a test-only change that moves multiline trailing-comma coverage from three subprocess-based cmdline.test cases into existing check-flags.test cases:

  • testCmdlineCfgEnableErrorCodeTrailingComma -> testPerModuleErrorCodesOverride
  • testCmdlineCfgDisableErrorCodeTrailingComma -> testDisableErrorCodeConfigFile
  • testCmdlineCfgAlwaysTrueTrailingComma -> testAlwaysTrueAlwaysFalseConfigFile

The existing check cases exercise the configured behavior, so the command-line cases can be removed without losing coverage. In testPerModuleErrorCodesOverride, truthy-bool is placed last so the value immediately before the trailing comma is exercised by the test.

Tests:

  • python -m pytest -n0 -q mypy/test/testcheck.py::TypeCheckSuite::check-flags.test (219 passed)
  • python -m pytest -n0 -q mypy/test/testcmdline.py -k "testCmdlineCfgFilesTrailingComma or testCmdlineCfgModulesTrailingComma or testCmdlineCfgPackagesTrailingComma" (3 passed)

Local targeted timing on Windows with pytest parallelism disabled (-n0), averaged across three runs:

  • Before, as three subprocess-based cmdline.test cases: 9.08s
  • After, as three check-flags.test cases: 0.54s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant