[mypy] Enable mypy for tests directory (#47018)

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>

Martin Hickey committed Jun 29, 2026 at 10:29 UTC a4e3cb40d07a1b43f6283cb77d560330b46369a9
1 file changed +76 -1
tools/pre_commit/mypy.py
+76 -1
@@ -25,6 +25,81 @@ import regex as re
25 # from "skip" to "silent", remove its directory from SEPARATE_GROUPS.
26 SEPARATE_GROUPS = [
27 "tests",
28 + "tests/benchmarks",
29 + "tests/compile/correctness_e2e",
30 + "tests/config",
31 + "tests/compile",
32 + "tests/compile/fullgraph",
33 + "tests/compile/fusions_e2e",
34 + "tests/compile/passes",
35 + "tests/distributed",
36 + "tests/entrypoints/anthropic",
37 + "tests/entrypoints/generate",
38 + "tests/entrypoints/llm",
39 + "tests/entrypoints/multimodal",
40 + "tests/entrypoints/openai",
41 + "tests/entrypoints/pooling",
42 + "tests/entrypoints/serve",
43 + "tests/entrypoints/speech_to_text",
44 + "tests/entrypoints/tool_parsers",
45 + "tests/entrypoints/unit_tests",
46 + "tests/entrypoints/weight_transfer",
47 + "tests/kernels",
48 + "tests/kernels/attention",
49 + "tests/kernels/core",
50 + "tests/kernels/helion",
51 + "tests/kernels/mamba",
52 + "tests/kernels/moe",
53 + "tests/kernels/quantization",
54 + "tests/lora",
55 + "tests/model_executor",
56 + "tests/model_executor/layers",
57 + "tests/model_executor/model_loader",
58 + "tests/models",
59 + "tests/models/test_initialization.py",
60 + "tests/models/language",
61 + "tests/models/multimodal",
62 + "tests/models/quantization",
63 + "tests/multimodal",
64 + "tests/parser",
65 + "tests/plugins_tests/gguf",
66 + "tests/plugins_tests/lora_resolvers",
67 + "tests/plugins/bge_m3_sparse_plugin",
68 + "tests/plugins/prithvi_io_processor_plugin",
69 + "tests/plugins/vllm_add_dummy_platform",
70 + "tests/plugins/vllm_add_dummy_stat_logger",
71 + "tests/plugins_tests",
72 + "tests/quantization",
73 + "tests/reasoning",
74 + "tests/renderers",
75 + "tests/samplers",
76 + "tests/spec_decode",
77 + "tests/tokenizers_",
78 + "tests/tool_parsers",
79 + "tests/tool_use",
80 + "tests/transformers_utils",
81 + "tests/utils_",
82 + "tests/v1",
83 + "tests/v1/attention",
84 + "tests/v1/core",
85 + "tests/v1/cudagraph",
86 + "tests/v1/determinism",
87 + "tests/v1/distributed",
88 + "tests/v1/e2e",
89 + "tests/v1/ec_connector",
90 + "tests/v1/engine",
91 + "tests/v1/executor",
92 + "tests/v1/kv_connector",
93 + "tests/v1/kv_offload",
94 + "tests/v1/logits_processors",
95 + "tests/v1/metrics",
96 + "tests/v1/sample",
97 + "tests/v1/shutdown",
98 + "tests/v1/simple_kv_offload",
99 + "tests/v1/spec_decode",
100 + "tests/v1/streaming_input",
101 + "tests/v1/structured_output",
102 + "tests/v1/worker",
103 ]
104
105 # TODO(woosuk): Include the code from Megatron and HuggingFace.
@@ -57,7 +132,7 @@ def group_files(changed_files: list[str]) -> dict[str, list[str]]:
132 file_groups[directory].append(changed_file)
133 break
134 else:
60 - if changed_file.startswith("vllm/"):
135 + if changed_file.startswith(("vllm/", "tests/")):
136 file_groups[""].append(changed_file)
137 return file_groups
138